I made a script that tests the length limits of “string”, “Unicode text” and «class utf8»:
If you choose “string” it returnes a maximum of: 16.270.000 characters
If you choose “Unicode Text” it returnes a maximum of: 8.000.000 characters
If you choose “«class utf8»” it returnes a maximum of: 8.000.000 characters
I couldn’t find any source with official limits in Applescript.
Are there any other known limits?
Limits for: “integer”, “number”, “real”, “list”, “record”?
(Limits refer to System 10.4.2)
set a to ".-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-"
set b to "" as string --or Unicode Text or «class utf8»
repeat 100 times
try
set b to b & a
on error
exit repeat
end try
end repeat
count b
-- b = ten thousand
set c to ""
repeat 100 times
try
set c to c & b
on error
exit repeat
end try
end repeat
count c
-- c = million
set d to ""
repeat 100 times
try
set d to d & c
on error
exit repeat
end try
end repeat
count d
repeat
try
set d to d & b
on error
exit repeat
end try
end repeat
count d
repeat
try
set d to d & a
on error
exit repeat
end try
end repeat
count d
repeat
try
set d to d & ".-.-.-.-.-"
on error
exit repeat
end try
end repeat
count d
set runs to 1
repeat 10 times
try
if (runs mod 2) = 0 then
set d to d & "-"
else
set d to d & "."
end if
set runs to runs + 1
on error
exit repeat
end try
end repeat
count d