Re: are finder items items? what is a vector?
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