• 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: finding out the name of the script file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >finding out the name of the script file (From: patrick machielse <email@hidden>)
 >Re: finding out the name of the script file (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Re: Folder action to rename files
  • Next by Date: Re: [newby] Detect if a script was started from the command line
  • Previous by thread: Re: finding out the name of the script file
  • Next by thread: Re: finding out the name of the script file (solved)
  • Index(es):
    • Date
    • Thread