• 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: Applescript equivalent of $0 in shell script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Applescript equivalent of $0 in shell script


  • Subject: Re: Applescript equivalent of $0 in shell script
  • From: Philip Aker <email@hidden>
  • Date: Sat, 07 Oct 2006 12:06:34 -0700

On 2006-10-07, at 11:29:11, Takaaki Naganoya wrote:

I can't understand about your whole program.
But you have some another option to aquire the name of script.

<English>
If you write to me in Japanese, I can give some suggestion,
But I'm not good speaker in English. Sorry.
</English>

Naganoya-san,

Can you translate this?

set ptm to (path to me)
set main to (((path to resource "Scripts" in bundle ptm) as string) & "main.scpt")
set spath to POSIX path of main

tell application "System Events"
activate
display dialog spath with icon caution
end tell

Save that as a script bundle (ptm.scptd). Then call from Terminal like:

# osascript ptm.scptd

 OK. I'll translate.

<English>
Philip is a well-known scripter. And he gave you an another option.
His idea is "Use script bundle. So you can indicate your resources folder and script
located in its inside.
</English>

Thanks Naganoya,

You can also use ".scpt" files. Save this as "ptm2.scpt"

--AppleScript
 
 POSIX path of (path to me)

--Terminal

# osascript ptm2.scpt

Philip Aker
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: 
 >Applescript equivalent of $0 in shell script (From: "Hiroshi T." <email@hidden>)
 >Re: Applescript equivalent of $0 in shell script (From: Takaaki Naganoya <email@hidden>)
 >Re: Applescript equivalent of $0 in shell script (From: Philip Aker <email@hidden>)
 >Re: Applescript equivalent of $0 in shell script (From: Takaaki Naganoya <email@hidden>)

  • Prev by Date: Re: Applescript equivalent of $0 in shell script
  • Next by Date: Re: Creating an environment variable from AppleScript
  • Previous by thread: Re: Applescript equivalent of $0 in shell script
  • Next by thread: Re: Applescript equivalent of $0 in shell script
  • Index(es):
    • Date
    • Thread