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: Matthew Smith <email@hidden>
- Date: Sat, 28 Feb 2009 07:48:55 +1100
- Thread-topic: using a shell variable in an osascript line?
on 28/02/2009 07:45 , Skeeve at email@hidden wrote:
> Matthew Smith schrieb:
>> Try:
>> osascript -e 'display dialog system attribute "VAR1"'
>>
>> For some reason I can't use display dialog. I get "no user interaction
>> allowed".
>>
> You're still on Tiger? I get the same with "dialog". But if you replace
> "display dialog" with "return" you see on STDOUT what your commands
> give: Nothing! :-(
>
> But try my solution (with the replacement mentioned above)
>
> osascript -e 'on run argv
> return (item 1 of argv)
> end run' "$VAR1"
I am on Leopard.
You need the variable to be defined otherwise it will return nothing.
osascript -e 'return system attribute "TMPDIR"'
Returns a value for me.
/var/folders/9A/9AtEPahnGSquLXI8HpyKG++++TI/-Tmp-/
_______________________________________________
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