Re: finding out the name of the script file
Re: finding out the name of the script file
- Subject: Re: finding out the name of the script file
- From: Christopher Nebel <email@hidden>
- Date: Thu, 25 Aug 2005 12:18:11 -0700
On Aug 25, 2005, at 6:55 AM, Michelle Steiner wrote:
On Aug 25, 2005, at 6:30 AM, patrick machielse wrote:
Is there a way to find out the script's file name?
Here is one way. It won't work from script editor, but will work
from the script menu. I offer it as proof of concept; it will most
likely need to be modified for your specific use.
tell application "Finder" to display dialog (name of (path to me)
as text)
Noting, of course, that "path to me" only returns the path to the
script file as of Tiger. In Panther and earlier (and in Tiger if
there is no file for the script, such as when using "osascript -
e ..."), "path to me" returns the path to the application running the
script. If you've saved the script as an application, then these are
the same thing.
--Chris Nebel
AppleScript and Automator Engineering
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden