Re: set vs copy?
Re: set vs copy?
- Subject: Re: set vs copy?
- From: Luther Fuller <email@hidden>
- Date: Tue, 14 Sep 2010 18:51:14 -0500
On Sep 14, 2010, at 4:01 PM, tom wible wrote: For paranoia's sake, I used copy, but I'm sure a set will do the trick. i've never seen a satisfactory explanation of exactly what a/s is doing in set vs copy...
I was working on this script this afternoon ...
set subFolderList to (get folders of folderRef) -- fast, but sorted in unix order repeat with subFolderRef in subFolderList ... end repeat
I wanted it to sort in Finder order, so I changed it to this ...
set subFolderList to (get sort folders of folderRef by name) as alias list -- correct order, but slow repeat with subFolderRef in subFolderList ... end repeat
The sort order is now correct, but it is noticeably slower than the original. Upon reading this thread, I tried using copy instead of set. (It couldn't hurt.) My script now becomes ...
copy (get sort folders of folderRef by name) as alias list to subFolderList -- fast repeat with subFolderRef in subFolderList ... end repeat
It is now fast again! Another reason for using copy instead of set.
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden