Re: set selection to clipboard
Re: set selection to clipboard
- Subject: Re: set selection to clipboard
- From: Mr Tea <email@hidden>
- Date: Fri, 19 Dec 2003 00:46:00 +0000
On 18 Dec 2003, at 11.32 pm, Guillaume Iacino wrote:
My problem is that I cannot find the word to use to get the selected
item.
For the folder I have:
tell application "Finder" to set the source_folder to (folder of the
front window) as alias
But:
set the source item to selection does not work.
Your variable name may be the problem. Try source_item instead.
tell application "Finder"
set source_item to selection
end tell
If just one item is selected, that will get you a reference to the item
(eg, file "x" of folder "y" of disk "z" of application "Finder"). If
more than one item is selected, the result will be a list of these
references, separated by commas and surrounded by wiggly brackets
(braces)
You need to coerce that reference into a path that you can usefully put
on the clipboard. This works in OS X 10.3
tell application "Finder"
activate
set source_item to selection as text
set the clipboard to source_item
end tell
and to do the same with the path to the folder of the front window
tell application "Finder"
activate
set source_Folder to target of Finder window 1 as text
set the clipboard to source_Folder
end tell
HTH
Nick
pp Mr Tea
_______________________________________________
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.