|
From a purely linguistic point of view, Script Debugger naturally tries to be as compliant as possible with the standard behavior of the AppleScript language. After all, it wouldn’t be good if you could write a script in Script Debugger which would not run properly in other environments. Sometimes, however, “standard behavior” means “buggy” or “inconvenient”. Apple’s Script Editor, for example, occasionally does things incorrectly, or badly, and Script Debugger, in doing better, must by definition do differently. This page summarizes some of the AppleScript differences between Script Debugger and Script Editor. Stop LogThe LibrariesScript Debugger’s libraries feature goes a long way towards solving the problem of modularizing scripts in a clean and simple way, but it isn’t compatible with other script-editing environments. That is why you have to flatten a script that uses libraries if you intend to edit it outside Script Debugger. Alternative OSA LanguagesA script editor is supposed to be able to open a compiled script file saved in any OSA language, not just AppleScript. Script Debugger can do this. Apple’s Script Editor used to be able to do it too, but in recent versions, it no longer can. Thus, if you save a script in debug mode, which uses the AppleScript Debugger X OSA language, or if you save a script in the JavaScript OSA language, Script Editor won’t be able to open it. PersistenceWhen a script is saved with Script Debugger, the current values of top-level properties and globals are saved along with it, and are still there when the script is opened again later. Script Editor strips these values when it opens a script. This point is worth a little further explanation. When you open a compiled script with Script Debugger, the values of top-level entities persist from the last time the script was executed. They are not reinitialized to their base values until the next time the script is compiled. (Merely running a script, without changing it, does not compile it.) So, for example, a script’s top-level property But if you so much as open the script with Script Editor, the persistent value is stripped out, so now when the script is run,
|
|||||||||||||||||