• 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: Newbie question: how to find my name
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie question: how to find my name


  • Subject: Re: Newbie question: how to find my name
  • From: "Marc K. Myers" <email@hidden>
  • Date: Wed, 06 Jun 2001 18:48:24 -0400
  • Organization: [very little]

> Date: Wed, 6 Jun 2001 08:30:51 -0700
> To: email@hidden
> From: James Bucanek <email@hidden>
> Subject: Newbie question: how to find my name
>
> Greetings,
>
> I'm ashamed to say that I just joined this list to ask one question:
>
> How do I find the name/file of the AppleScript I'm running.
>
> I know that me/my refers to the executing script object, but I've
> honestly not found any documentation on the properties of a script
> object. I have the AppleScript Language Guide, Finder Guide,
> extensions Guide.
>
> I'll also concede that I may be going about this all wrong.
>
> Here's my problem that I thought AppleScript could solve:
>
> I've got a debugging environment where any one of a dozen
> applications get launched by another (control) application. What I
> wanted to do was insert an executable AppleScript where the target
> application is expected to be. When the AppleScript get launched, it
> would find the real application and launch the debugger.
>
> My plan was simple. I'd create a single AppleScript application that
> would get renamed to the name of whatever application it's standing
> in for. When it runs, it would find out it's name, which would tell
> it which application and symbol file it needs to find.
>
> Any and all suggestions are welcome.

set myFile to (path to me)
tell application "Finder" to set myName to name of myFile

or

set myFile to (path to me)
set {od, AppleScript's text item delimiters} to {AppleScript's text item
delimiters, {":"}}
set myName to text item -1 of (myFile as text)
set AppleScript's text item delimiters to od

Marc K. Myers <email@hidden>
http://AppleScriptsToGo.com
4020 W.220th St.
Fairview Park, OH 44126
(440) 331-1074

[6/6/01 6:48:14 PM]


  • Prev by Date: Re: startup disk scripting
  • Next by Date: Re: carriage return & line feeds
  • Previous by thread: Newbie question: how to find my name
  • Next by thread: QXP and changing text attributes
  • Index(es):
    • Date
    • Thread