newbie question: AppleScript and hashbang
newbie question: AppleScript and hashbang
- Subject: newbie question: AppleScript and hashbang
- From: Peter Vandenberk <email@hidden>
- Date: Mon, 24 Apr 2006 12:09:07 +0100
Hi all,
Quick question: I wrote the following AppleScript...
#!/usr/bin/osascript
tell application "System Events" to return name of processes
... but when executing the script (after chmod +x) I get the
following error message...
./processes.scpt:0:1:
script error: A unknown token can't go here. (-2740)
... which I assume stems from the fact that AppleScript doesn't
recognise '#' as a comment token (as it only seems to recognise the
'--' token for single-line comments).
I can obviously re-write the above script as follows...
#!/bin/sh
/usr/bin/osascript \
-e 'tell application "System Events" to return name of processes'
... but that just makes you go hmmmmmmmmmm.
So my newbie question is pretty straightforward: is there a more
elegant way to write hashbang-enabled AppleScripts (or, more
generally, osascripts)?
Many thanks,
Peter Vandenberk
_______________________________________________
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