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

Re: Comprehensive Applescript Reference Book (Re: Applescript equivalent of $0 in shell script)


  • Subject: Re: Comprehensive Applescript Reference Book (Re: Applescript equivalent of $0 in shell script)
  • From: Philip Aker <email@hidden>
  • Date: Sat, 14 Oct 2006 14:11:36 -0700

On 2006-10-13, at 21:42:29, Hiroshi T. wrote:

Thanks to all of you who replied to me.

The command
path to me
or
name of current application
should be the Applescript equivalent of $0.
But neither of them works in iTunes scripts menu.

On Oct 7, 2006, at 4:55 PM, Philip Aker wrote:

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

This script cannot be saved due to syntax error in the second line.

The requirements for 'path to me' in the above script are OS X 10.4 minimum, saved as a script bundle, and that it be run from a suitable executable.
There is no problem saving the above script in OS X 10.4.8. But you can not run it in Script Editor.


You can put it in ~/Library/Scripts and run it from the Script menu in the menu bar.

You can run it in Terminal by:

	% osascript ptm.scptd

I don't know much about iTunes but you can always run a script which calls 'osascript' to call your script.


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
  • Follow-Ups:
    • Re: Comprehensive Applescript Reference Book (Re: Applescript equivalent of $0 in shell script)
      • From: "Hiroshi T." <email@hidden>
References: 
 >Comprehensive Applescript Reference Book (Re: Applescript equivalent of $0 in shell script) (From: "Hiroshi T." <email@hidden>)

  • Prev by Date: Re: App and droplet
  • Next by Date: Re: Comprehensive Applescript Reference Book
  • Previous by thread: Comprehensive Applescript Reference Book (Re: Applescript equivalent of $0 in shell script)
  • Next by thread: Re: Comprehensive Applescript Reference Book (Re: Applescript equivalent of $0 in shell script)
  • Index(es):
    • Date
    • Thread