…before invoking a -20013 error?
Is it a matter of items, or is it the number of individual characters in total?
TIA
Doug
It would probably be number of items in the list. But I’m not sure what the limit is… Anyone else?
Hi Doug,
I just did a couple of tests and couldn’t produce an error. The unscientific
test consisted of a repeat loop (20,000 times) which copied a four letter
word to the end of a list. I’ll attempt to push it until it errors but the script
takes quite some time to run, so it may take a while to hit the limit.
Do you have a script which is producing the error or are you just preparing
for it?
Rob J
I think it depends on memory and if the text field that you are using uses the Text Edit Manager (which has a 32k limit. If you’re running it in the Script Editor then it’s the Script Editor’s memory and its text field limit. If from a script application then the script’s memory can be increased. Then, the variable can hold a lot. But, if you show your list like say in Dialog Director then its text field also has the 32k limit I think. One error you may get from the Script Editor is because the result window has a limit (probably 32k).
I just ran the script for 70,000 iterations and still didn’t hit any limits. This created a list of 70,000 four letter words. FYI, my environment is OS 9.1, AppleScript 1.6 and Script Debugger 3.x.
Uncle! I give up!
Rob J
P.S. The four letter word was “word”.
Hi,
I got this from the AppleScript Language Guide. To speed up things use the ‘a reference to’ operator. For instance:
set the_list to {}
set the_list_ref to a reference to the_list
repeat 50000 times
copy "word" to end of the_list_ref
end repeat
display dialog ((the data length of the_list) as string) & " bytes."
Note: for really big list, as Rob says you need to copy or set to the end of the list instead of concatenating.
Sorry about this, but, the last line uses Akua Sweets. I put that in so that the result window wouldn’t try to show the list.
There may be ways to overcome those limits ( e.q. do not use those apps, writing and reading the long list to/from a file, chunk by chunk).
I am not sure what the physical limits are, but would be surprised if they would surpass RAM / disk space
Eelco Houwink