How do you efficiently build a list within a handler in AppleScript?
问题 AppleScript documentation suggests the following code to efficiently build a list: set bigList to {} set bigListRef to a reference to bigList set numItems to 100000 set t to (time of (current date)) --Start timing operations repeat with n from 1 to numItems copy n to the end of bigListRef end set total to (time of (current date)) - t --End timing Note the use of an explicit reference. This works fine at the top level of a script or within an explicit run handler, but if you run the same exact