Re: Script to Get Finder Selection?
Re: Script to Get Finder Selection?
- Subject: Re: Script to Get Finder Selection?
- From: "Marc K. Myers" <email@hidden>
- Date: Fri, 1 Aug 2003 15:46:11 -0400
Date: Thu, 31 Jul 2003 23:35:37 -0400
To: email@hidden
From: "Jonathan Levi, M.D." <email@hidden>
Subject: Script to Get Finder Selection?
Cc: "Jonathan Levi, M.D." <email@hidden>
Hi,
I'm trying to write an AppleScript that utilizes the Finder front
window's selected item(s). For a selection of 1 item,
get selection of application "Finder" as Unicode text
works, but I haven't found any ready way to get a selection
containing multiple items. It looks like I can save this selection,
write it out to a text file, and process the resulting file, but this
will involve handling lots of binary gobbledygook: can anybody
suggest a more straightforward way to access the selection?
I think this will give you what you want:
set theList to {}
tell application "Finder" to set theSel to selection
repeat with anItem in result
set end of theList to anItem as alias
end repeat
The "theList" variable will contain a list of aliases representing the
selection.
Marc [08/01/03 3:42:56 PM]
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.