Re: Passing calls to an AS app via shell?
Re: Passing calls to an AS app via shell?
- Subject: Re: Passing calls to an AS app via shell?
- From: Chris Espinosa <email@hidden>
- Date: Fri, 8 Oct 2004 13:35:22 -0700
The best way to send params to an OSAScript is to set them as
environment variables in the Shell, then use 'system attribute' in the
AppleScript to access them:
$ export dd_string=`sw_vers -productVersion`
$ osascript -e 'set theVersion to system attribute "dd_string"' -e
'tell application "Terminal"' -e 'display dialog "Version: " &
theVersion' -e 'end tell'
Note a couple of things here:
- The environment variable will only be available in the script
executed from the shell. If you put the "set" above inside the "tell"
block, it would come up with nothing, as it would get System Attributes
in effect at the time Terminal was launched
- You can do this with applets launched from the shell, if the applet
is launched with the "open" command from the shell that defines the
environment variable
Chris
_______________________________________________
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