There is an even worse issue that has cropped up regarding "the defaultstack" in a multi-window application
If you have a script executing and present a open file/save file dialog (which are now non-modal windows under OSX and Windows), the user can click on other application windows, which cause the clicked-on window to be "topLevel" and hence the new defaultStack and then click backc to the open file "dialog" (which are not real dialogs any more) and respond. Your paused script continues executing, but now the defaultStack has changed. As a precaution against users of the app doing (resonable) things like this, I now explicitly set the defaultStack after any ask or answer file dialog. I also use code such as on handler put the defaultStack into tPreserveDefaultStack set the defaultStack to <this stack by name> ... my code... set the defaultStack to tPreserveDefaultStack end handler So that if the hander is called from another stack it does not exit with the defaultstack changed. _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode