• 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: are finder items items? what is a vector?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: are finder items items? what is a vector?


  • Subject: Re: are finder items items? what is a vector?
  • From: Jon Pugh <email@hidden>
  • Date: Sat, 26 Dec 2009 09:11:38 -0800

At 10:24 AM +0100 12/26/09, Brennan wrote:
>Great! Thanks to all for the responses, which have been usable and interesting.

I looked at the various submissions and ran them on the same folder looking at speed.  Deivy Petrescu's version won handily, and with the bonus of working on the desktop.  His was twice as fast as mine, and the original one with the Finder objects was abysmally slow at 5 times slower than mine (10 times slower than this one).

I think minimizing the number of AppleEvents is a major win here, and apparently doing alias comparisons is pretty quick too.

Good job Deivy.

Jon


tell application "Finder"
	set inverted to {}
	set sel to selection as alias list
	set cont to container of item 1 of (get selection) as alias
	set fitems to every item of cont as alias list
	repeat with i in fitems
		set i to contents of i
		if i is not in sel then set end of inverted to (i as alias)
	end repeat
	set selection to {}
	select inverted
end tell
 _______________________________________________
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

References: 
 >Re: are finder items items? what is a vector? (From: Brennan <email@hidden>)

  • Prev by Date: Re: are finder items items? what is a vector?
  • Next by Date: Get script's folder from within the script
  • Previous by thread: Re: are finder items items? what is a vector?
  • Next by thread: Merry Christmas!
  • Index(es):
    • Date
    • Thread