5th August 2012, 02:11 PM | #1 |
Junior Member
Member
Join Date: Nov 2011
Posts: 10
|
Disable tk_messageBox using global variable
Hi, im doing some batch script conversion using TCL
Im getting these annoying tk_messageBox that completely stop my process. Code:
sending command to TCL: set tkms [tk_messageBox -title "AC3D message" -message "Warning: 1356 objects did not have textures assigned. You must assign a texture to every object for X-Plane output." -type ok -icon info -parent . ] Code:
set_unsaved_changes 0 Is there any similar global variable or set proc to disable these tk_messageBox as well? these look like standard TCL and i cant modify the plugin that is calling them cause i dont have the source code. ive looked into various TCL files and using ac3d list but found no similar proc. thanks a lot. |
9th August 2012, 06:13 AM | #2 |
Administrator
Professional user
Join Date: Jun 2003
Posts: 4,565
|
Re: Disable tk_messageBox using global variable
Have you tried redfining tk_messageBox as new proc? Might work.
|
26th September 2013, 07:29 AM | #3 |
Junior Member
Member
Join Date: Aug 2013
Location: London UK
Posts: 22
|
Re: Disable tk_messageBox using global variable
Inserting this into a tcl script file (in /programs/ac3dxxx/scripts) will disable messageBoxes entirely.
proc tk_messageBox {args} { return "no" } The disadvantage is that all messageBoxes will return no; this may affect any command which calls tk_messageBox. you may prefer to return "yes" of course. You should ensure that the replacement tk_messageBox is only installed when you don't want messages. One way is: rename tk_messageBox tk_messageOriginal proc tk_messageBox {args} { return "no" } # # ... do all your scripted operations which used to annoy with messageBoxes # rename tk_messageOriginal tk_messageBox The final line will reinstate standard tk_messageBox behaviour. |
15th October 2013, 10:46 AM | #4 |
Junior Member
Member
Join Date: Aug 2013
Location: London UK
Posts: 22
|
Re: Disable tk_messageBox using global variable
Opps one minor error - add
rename tk_messageBox {} before rename tk_messageOriginal tk_messageBox otherwise the proc "tk_messageBox" already exists and cannot be overwritten. Renaming tk_messageBox to {} (the empty string) destroys its (temporary) version. |
|
|