• 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: finder selection question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: finder selection question


  • Subject: Re: finder selection question
  • From: Luther Fuller <email@hidden>
  • Date: Wed, 25 Jul 2007 06:38:09 -0500

I needed that yesterday and found this handler in another script. Notice that it returns the selection as a list of aliases.

on getFinderSelection()
	tell application "Finder"
		try
			set selList to selection
		on error
			return {}
		end try
		--
		set listCount to (count items of selList)
		if listCount = 0 then return {}
		repeat with i from 1 to listCount
			(item i of selList) as alias
			set item i of selList to the result
		end repeat
		return selList
	end tell
end getFinderSelection

On Jul 25, 2007, at 6:30 AM, Bob Cuilla wrote:

Good morning to everyonel

I would like to do the following operation.

1. Select a file in the finder, not through AS but by simply a mouse click.

2. Then Run a script that uses the previously selected item (above) as its target.


How can I refer to the "selected/clicked" finder item within my script?

_______________________________________________ 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: 
 >finder selection question (From: Bob Cuilla <email@hidden>)

  • Prev by Date: finder selection question
  • Next by Date: Re: Spotlight Plugin for AS ?
  • Previous by thread: finder selection question
  • Next by thread: Re: finder selection question
  • Index(es):
    • Date
    • Thread