• 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 program name on start
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: get program name on start


  • Subject: Re: get program name on start
  • From: Michelle Steiner <email@hidden>
  • Date: Wed, 2 Sep 2009 16:12:58 -0700


On Sep 2, 2009, at 2:54 PM, Stan Cleveland wrote:

   set scriptLocation to (path to me) as string
   --> "Macintosh HD:Users:stanc:Desktop:TestScript.scpt"

You can parse the script name from the path string.

This works:

tell application "System Events" to get name of (path to me)
-- you can also use Finder instead of System Events, but I understand that it's better to use System Events instead of Finder wherever possible.

It returns the name of a saved script (either as a compiled script or as an application); if the script has not been saved, though, it returns the name of the editor.

-- Michelle

--
Your right to free speech does not incur an obligation for anyone to listen.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: get program name on start
      • From: Stan Cleveland <email@hidden>
References: 
 >Re: get program name on start (From: Stan Cleveland <email@hidden>)

  • Prev by Date: Re: Script Fails in Snow Leopard - Adobe Unit Types.osax
  • Next by Date: Re: scroll area error
  • Previous by thread: Re: get program name on start
  • Next by thread: Re: get program name on start
  • Index(es):
    • Date
    • Thread