• 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: Wed, 23 Dec 2009 14:44:41 -0800

At 10:44 PM +0100 12/23/09, Brennan wrote:
>I'm trying to write a script which will invert the Finder selection.

I don't claim this is the only or even the best way, but it works.  ;)

Jon


tell application "Finder"
	set inverted to {}
	set itemNames to name of items of window 1
	set selectedNames to {}
	set s to selection
	repeat with i in s
		copy name of i to end of selectedNames
	end repeat
	set newSelection to {}
	repeat with i in itemNames
		if i is not in selectedNames then
			copy item i of window 1 to end of newSelection
		end if
	end repeat
	select newSelection
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: 
 >are finder items items? what is a vector? (From: Brennan <email@hidden>)

  • Prev by Date: are finder items items? what is a vector?
  • Next by Date: Re: are finder items items? what is a vector?
  • Previous by thread: are finder items items? what is a vector?
  • Next by thread: Re: are finder items items? what is a vector?
  • Index(es):
    • Date
    • Thread