• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: set vs copy?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: set vs copy?
      • From: Alex Zavatone <email@hidden>
References: 
 >set vs copy? (From: tom wible <email@hidden>)

  • Prev by Date: Re: set vs copy?
  • Next by Date: Re: set vs copy?
  • Previous by thread: Re: set vs copy?
  • Next by thread: Re: set vs copy?
  • Index(es):
    • Date
    • Thread