Re: set vs copy?
Re: set vs copy?
- Subject: Re: set vs copy?
- From: "Nigel Garvey" <email@hidden>
- Date: Wed, 15 Sep 2010 09:13:28 +0100
Luther Fuller wrote on Tue, 14 Sep 2010 18:51:14 -0500:
> 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.
I'm not able to confirm any consistent speed difference between the two
here. I can tell you that within a Finder context, 'copy' is the long-
NOT-AVAILABLE-YET command for copying selected items to the clipboard
and it still works as an incorrect substitute for 'duplicate', so its
use as a substitute for the AppleScript command 'set' can't be
considered safe.
Also, the 'get' in the above code is entirely superfluous and 'as alias
list' only produces aliases from Finder references, not from Finder commands.
NG
_______________________________________________
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