Re: Comprehensive Applescript Reference Book (Re: Applescript equivalent of $0 in shell script)
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