• 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 22:55:01 -0700

On 2006-10-14, at 17:24:39, Hiroshi T. wrote:

Thanks for your reply.
Unfortunately I'm on 10.3.9 and cannot upgrade to Tiger for various reasons such as application compatibility.

There is not much choice in AppleScript in 10.3.9 except for "path to me" in a script saved as an 'application bundle'. 

I'm not entirely clear on what you want to accomplish, but you can script application bundles easily with regular scripts:

Here's an application bundle called "doit"

on xxx(theList)
display dialog (item 1 of theList)
end xxx

on yyy(theRecord)
display dialog theRecord's name
end yyy

on ptm()
return POSIX path of (path to me)
end ptm


Here's a regular script calling the "doit" application:

tell application "doit"
activate
xxx({"Some good thing", "Some bad thing"})
yyy({name:"Hiroshi"})
ptm()
end tell

There are other scripting facilities too. Tcl scripting language <x-man-page://tclsh> has AppleScript support (maybe some others like Python and Perl too). My OSA components TclOSA, PerlOSA, PythonOSA, RubyOSA, ShOSA might be of some help, and I believe appscript for Python by Hamish Sanderson has some iTunes scripting examples. 


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

  • Prev by Date: Re: Comprehensive Applescript Reference Book (Re: Applescript equivalent of $0 in shell script)
  • Next by Date: Re: Human Readable Time snipit
  • Previous by thread: Re: 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