• 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, 21 Oct 2006 04:04:30 -0700

On 2006-10-19, at 09:47:42, Bruce Robertson wrote:

#!/bin/sh
# tclsh ignores the next line because comments are continued with a
backslash \
exec tclsh "$0" "$@"

package require Tclapplescript

AppleScript execute {
tell application "Finder"
activate
display dialog "Wins the Lottery!" with icon note
end tell
}

PS: Watch it if you clip this from Apple Mail, sometimes spurious characters not good for shell scripts creep in depending on encoding factors. You should be able to get rid of them by using the 'nano' editor.

Thanks! I note this commment from the end of the documenation you mention:

"The AppleScript command is a stopgap command to fill the place of exec on the Mac. It is not a supported command, and will likely change as we broaden it to allow communication with other OSA languages."

That's from System 7 as well (Tcl did not have the 'exec' command implemented on OS 7/8/9). It's position on OS X is at the highest per- platform level of extensions. The directory containing those is located at /System/Library/Tcl.


As things stand today, using TclApplescript will be faster than using osascript because it keeps the component loaded until the caller quits or you call 'package forget Tclapplescript'.

BTW, the original author of this extension is Jim Ingham. He has been an engineer with Apple since OS X (on the debugging team) but championed Tcl on the Mac for 10 years before that at Sun and Lucent.


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: Archives: http://lists.apple.com/mailman//archives/applescript-users

This email sent to email@hidden
References: 
 >Re: Comprehensive Applescript Reference Book (Re: Applescript equivalent of $0 in shell script) (From: Bruce Robertson <email@hidden>)

  • Prev by Date: Re: FileMaker (Pro Advanced 8) bug?
  • Next by Date: Re: Mac dates ==> UNIX dates
  • Previous by thread: Re: Comprehensive Applescript Reference Book (Re: Applescript equivalent of $0 in shell script)
  • Next by thread: Re: Comprehensive Applescript Reference Book
  • Index(es):
    • Date
    • Thread