• 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: Stan Cleveland <email@hidden>
  • Date: Wed, 02 Sep 2009 14:54:14 -0700
  • Thread-topic: get program name on start

On 9/2/09 1:19 AM, "Tobias Exner" wrote:

> I'm thinking about to create multiple applescripts. Because there will
> be a small difference in the code between them I want to create only one
> program and control the behaviour using the name of the program.
>
> My question: Is there a way to get the own name of the program on start?

Tobias, the following may help you:

    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 code works when run within a script application, but won't work when
the script is run from Script Editor, which will affect how you do testing.

Stan C.


 _______________________________________________
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: Michelle Steiner <email@hidden>
References: 
 >get program name on start (From: Tobias Exner <email@hidden>)

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