• 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: Get Name of Current Script?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Get Name of Current Script?


  • Subject: Re: Get Name of Current Script?
  • From: "Reese, Stevan" <email@hidden>
  • Date: Thu, 30 Sep 2004 22:25:40 -0700

Title: Re: Get Name of Current Script?
Running from the editor, log follows

tell
application "Finder"
    set x to path to me
   set y to name of file x as text
   display dialog (x as text) & return & y
end tell

tell current application
   path to current application
       alias "Macintosh HD:Applications:AppleScript:Script Editor.app:"
end tell
tell
application "Finder"
    get name of file (alias "
Macintosh HD:Applications:AppleScript:Script Editor.app:")
        "
Script Editor.app"
    display dialog "
Macintosh HD:Applications:AppleScript:Script Editor.app:
Script Editor.app
"
        {button returned:"
OK"}
end tell

Same script run as an application displays this dialog;

Macintosh HD:Users:sreese:Desktop:testscript.app
testscript.app


Stevan

> From: Johnny AppleScript <email@hidden>
> Date: Thu, 30 Sep 2004 22:40:29 -0600
> To: <email@hidden>
> Subject: Get Name of Current Script?
>
> I seem to remember this is possible with Smile, but is there a vanilla way
> to get the name, and better, the path of a running script (not applet)
> executed from a script menu from an app like iTunes?
>
> Something like (path to me) which returns the parent AS engine, but instead
> the path of the script?
>
> (path to script)?
> (name of me) ?
>
> TIA -- (a hopeful) JA
>
>  _______________________________________________
> 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
 _______________________________________________
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: 
 >Get Name of Current Script? (From: Johnny AppleScript <email@hidden>)

  • Prev by Date: Get Name of Current Script?
  • Previous by thread: Get Name of Current Script?
  • Index(es):
    • Date
    • Thread