Re: using a shell variable in an osascript line?
Re: using a shell variable in an osascript line?
- Subject: Re: using a shell variable in an osascript line?
- From: LuKreme <email@hidden>
- Date: Fri, 27 Feb 2009 18:12:34 -0700
On 27-Feb-2009, at 02:40, Axel Luttgens wrote:
If I understood you correctly, you have a single shell script with
multiple statements; among those statements, two are of interest here:
[...]
VAR1=`tail -1 /var/log/mail.log`
[...]
osascript -e "display dialog $VAR1"
[...]
OK,not exactly. I have a variable that I use in the shell script
portion of my script and I then want to use it in an osascript
statement. Nothing quite works. I'm not talking about secifically a
display dialog, but perhaps, for example:
osascript -e 'tell application "myapp" to set "theSelection" to $VAR1'
I ended up doing this:
VAR1=`<whatever>`
echo $VAR1 > /tmp/osacript.tmp
osascript -e "set myVAR1 to (do shell script \"cat tmp/osacript.tmp
\") as text"
It's fugly. It works. Not done extensive testing though.
--
"Back off, man. I'm a scientist."
_______________________________________________
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/archives/applescript-users
This email sent to email@hidden