Re: newbie question: AppleScript and hashbang
Re: newbie question: AppleScript and hashbang
- Subject: Re: newbie question: AppleScript and hashbang
- From: Christopher Nebel <email@hidden>
- Date: Mon, 24 Apr 2006 12:24:51 -0700
On Apr 24, 2006, at 8:21 AM, Peter Vandenberk wrote:
So my newbie question is pretty straightforward: is
there a more elegant way to write hashbang-enabled
AppleScripts (or, more generally, osascripts)?
After posting my original question, I did some more googling and
found the following hack:
http://www.macosxhints.com/article.php?story=20040617170055379
Anyone know of another approach? Thanks again,
Well, you could do something like this:
#!/bin/sh
sed -e '1,4d' $0 | osascript
exit 0
# Script begins after this line.
"hello" & " " & "world"
Here-documents usually work pretty well, though.
Also, I should point out that the bit in that article about it being
"difficult with osascript to pass command-line parameters to the
AppleScript" is out of date as of Mac OS X 10.4 (Tiger) -- read the
osascript(1) man page for instructions.
--Chris Nebel
AppleScript and Automator Engineering
_______________________________________________
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