Is there a secret to efficiently dealing with “large” NSMutableArrays in AppleScript? Something like the following (silly example) appears to run in a fraction of a second when written as Objective C but takes about half a minute in AppleScript.
use framework "Foundation"
property NSMutableArray : a reference to current application's NSMutableArray
set menuItems to NSMutableArray's arrayWithArray:{}
repeat with i from 0 to 30000
(menuItems's insertObject:"test" atIndex:i)
end repeat
set newMenuItems to NSMutableArray's array()
repeat with i from 0 to (menuItems's |count|()) - 1
(newMenuItems's addObject:(menuItems's objectAtIndex:i))
end repeat