Re: get path of selected file
Re: get path of selected file
- Subject: Re: get path of selected file
- From: Paul Berkowitz <email@hidden>
- Date: Wed, 03 Apr 2002 12:50:30 -0800
On 4/3/02 12:27 PM, "Matt Binkowski" <email@hidden> wrote:
>
i used to have a handly little script that could retrieve the path of any
>
selected file or folder but I seem to have lost it in the transition to os
>
X...and to make matters worse, i cannot seem to remember how to write it
>
again. i want to run the script from the script menu (like osa menu in 9) on
>
a file that is selected in the finder. can anyone please help? even just
>
hints on the syntax?
try
tell application "Finder" to set pathToFile to (item 1 of (get
selection)) as alias as string
on error
beep
display dialog "There's nothing selected in the Finder." buttons {"OK"}
default button 1 with icon 2
return
end try
-- display dialog pathToFile
----
You can display it in a dialog or do whatever you want with it. I have a
script set up in Script Debugger's script menu to type it into any script
I'm writing where the cursor is. You can do exactly the same thing in Smile.
--
Paul Berkowitz
_______________________________________________
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.