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: "Mark J. Reed" <email@hidden>
- Date: Fri, 27 Feb 2009 09:45:51 -0500
LuKreme> osascript -e "display dialog $VAR1"
That won't work because $VAR1 gets expanded by the shell before
osascript ever sees it, and whatever its contents are, they're
probably not valid as Applescript code.
Axel> osascript -e "display dialog \"$VAR1\""
Better, but fails if $VAR1 includes any double quotes.
Assuming your shell is bash, this will work:
osascript -e "display dialog \"$(printf %q "$VAR1")\""
--
Mark J. Reed <email@hidden>
_______________________________________________
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