On Aug 11, 2011, at 1:48 PM, Zavatone, Alex wrote:
I've currently got one script that's 2097 lines, including white space.
Do any of you run/crate scripts this size?
If so, are you having any size related issues with the script in either the AS editor or the Script Debugger?
Hi Alex,
I have a number of scripts that exceed 2000 lines and a couple well over 5000 lines. There's only one gotcha that I know of (and I've hit it a few times in the past), which is that there's a limitation on the number of "style runs" allowed within one script.
What's a style run you ask? It's a contiguous section of code that shares the exact same font/style/color for its syntax coloring. When the font, style, or color changes, that's the start of a new style run. A single line of code can contain many style runs. The following one contains fifteen (including the parentheses and comma):
set theFolder to choose folder with prompt thePrompt default location (path to desktop) without invisibles, multiple selections allowed and showing package contents
To quote an email from Mark Alldritt, "Enabling debugging in Script Debugger...makes this worse because Script Debugger introduces hidden code into your script in order to facilitate step-wise execution. This effectively shortens the maximum size for scripts." The hidden code effectively introduces more style runs.
I've done two things to counter this problem. First, I've simplified my syntax coloring preferences by eliminating bold and italics and have switched to one color for related items. (All the scripting addition stuff, for example, is purple.)
Second, I've made use of AppleMods Loader ( http://applemods.sourceforge.net/) for loading my own, custom-written handler libraries. This removes many handlers from the main script. Of course, there are any number of ways to load libraries, including Script Debugger's "Library" functionality and the load script command from Standard Additions. I prefer the simplicity and robustness of AppleMods.
HTH, Stan C.
|