• 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: How to get name of classic app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get name of classic app


  • Subject: Re: How to get name of classic app
  • From: Paul Berkowitz <email@hidden>
  • Date: Sat, 15 Sep 2001 13:04:44 -0700

On 9/15/01 12:54 PM, "Rob Jorgensen" <email@hidden> wrote:

> On 09/15/2001, Irwin Poche commented:
>
>> How can a script saved as a classic applet get it's name ?
>>
>> I have tried every combination of me, my, and name I can think of. For
>> instance...
>>
>> me
>> name of me
>> name of me as text
>> my name
>> tell me to get my name
>> etc...
>
> This works for me:
>
> tell application "Finder" to set myName to (name of (path to me as alias))
> display dialog myName
>
>
But it's not safe to put 'path to me' in a Finder tell block. Odd things can
happen. (And you don't really need "as alias": that's the default.)This
would be safer:


set myPath to (path to me)
tell application "Finder" to set myName to (name of myPath)
display dialog myName


Another method:

set myPath to (path to me as string)
set {tids, AppleScript's text item delimiters} to {AppleScript's text
item delimiters, {":"}} -- one line
set myName to last text item of myPath
set AppleScript's text item delimiters to tids
display dialog myName

--
Paul Berkowitz


References: 
 >Re: How to get name of classic app (From: Rob Jorgensen <email@hidden>)

  • Prev by Date: Re: Scriptable Text Editor v.1.1
  • Next by Date: Re: Apple Data Detectors with AS ?
  • Previous by thread: Re: How to get name of classic app
  • Next by thread: Re: How to get name of classic app
  • Index(es):
    • Date
    • Thread