AppleScript's script size limit
AppleScript's script size limit
- Subject: AppleScript's script size limit
- From: Paul Berkowitz <email@hidden>
- Date: Sun, 20 Oct 2002 11:28:04 -0700
OS 10.2.1, AS 1.9
Just to make clear I'm not discussing Script Editor's 32K limit, but a limit
discovered in AppleScript itself, confirmed as identical in both Script
Debugger 3.0.5 and Smile 2.4.6 in OS 10.2.1/AS 1.9.
AppleScript cannot compile scripts larger than about 140K source text, I say
"about" because it seems to vary a little depending on the "parts of speech"
- the syntax. Not the AppleScript formatting - removing ALL formatting and
having every single syntax element as Geneva 10 plain text made no
difference whatsoever , unlike a much higher limit i once discovered back in
AS 1.3.7 (OS 8.6) and unlike a much lower limit related to style runs with
the AppleScript Debugger language.
The precise limit i found when adding "too much" to a large script was
140693 characters
140688 was still OK. The script compiled no matter what the formatting.
Changing one test line
set p to p
to
set p to p & ""
and it got an error -108. In SD that comes accompanied by an error message
to the effect that "Couldn't complete the last command because there was not
enough memory. Result Code -108". In Smile it's just a simple "Error:
-108".
Changing that line to
set p to p & p
or
set p to ppppp
still compiles, but hits the same error with a few more characters added in.
If the line is commented out, you can add about 40 more characters before
you hit the error. So it must depend partly on the number of different
syntactic elements in the script. Changing AppleScript formatting to no
formatting makes no difference at all. The errors occur in exactly the same
places.
Probably it's not that common to want to compile and save scripts longer
than 141K. But I can't be the only one. That's not really so immense as all
that: just a little over four times Script Editor's puny 32K. I can work
around it by loading assistant script libraries, which I might do more of in
any case.
But it seems to me that the limit I once hit in AS 1.3.7 was much higher
than that. Is the AppleScript team even aware of this 140K limit, or do they
do all their testing in Script Editor? Is this limit something essential,
built in, or could it be expanded?
--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.