Hi there
I've written some huge stay-open-script-apps that runs on servers. They used to have a well-known problem with quitting – I got the error message that the app couldn't save data (sorry, I don't remember the error code) – and, worse, the app didn't quit. I have been trying to get around this problem by saving as much of the changing data in a property list instead of in Applescript properties, and in other cases by resetting the properties initial values. But with no success - maybe because the scripts are so big that I missed something.
Instead I have a workaround: In the quit handler, after some clean up measures being done, it just force quits itself. Like this (simplified example):
global gAppName set gAppID to false tell application "System Events" set myPathH to (path to me) as string set fullAppName to (name of alias myPathH) set gAppID to unix id of process gAppName -- Script Editor should not be force quitted if runned from there end tell
on idle -- huge code mass end idle
on quit my doCleanUps() -- clean up ssteps do shell script "kill " & my gAppID end quit
Now, this workaround works fine! But my questions is: Can you see any drawbacks with his method? For example concerning memory usage on the machine?
Thanks in advance for any advice or information Jörgen
Page production managerTT-Gruppen Phone: +46 691 16 09 Cell: +46 70 372 44 46 Mail: TT-Gruppen, 105 12 Stockholm, Sweden
|