Re: Calling Applescript from Unix Shell scripts
Re: Calling Applescript from Unix Shell scripts
- Subject: Re: Calling Applescript from Unix Shell scripts
- From: email@hidden
- Date: Fri, 27 Jul 2007 15:24:46 -0400
Hello Doug,
Thanks very much for the help! Unfortunately, so far I only have more
questions, rather than enlightenment.
When I've tried to run my existing Applescripts through osascript, I
usually receive the error "execution error: No user interaction allowed.
(-1713)." I could probably break up my Applescripts into several
separate scripts that do and do not use dialogs, if necessary.
I tested your example as typed in the Terminal app, and did not see any
output to the Terminal screen. Should I have seen anything?
And finally, could you show an example of setting a shell variable using
the backtick trick from an Applescript? I couldn't find any
documentation on that.
- Rick
Doug McNutt wrote:
At 14:24 -0400 7/27/07, email@hidden wrote:
I've looked through the archives for answers to these questions. Unfortunately the terms are so generic that I usually end up with results that talk about "do shell script". Sorry if these are questions that come up often. Please feel free to refer me to any other threads or FAQs.
Inside my shell scripts, I occasionally run Applescript .app files in order to present some GUI dialog boxes, or to mess around with alias files, or whatever.
1) Is there a way to have Applescript output text that can end up in the Installer's log file? Most likely the Applescript would need to be able to write to stdout.
2) Is there a way to return an error code to the caller (Unix shell script)? The Return command in my main Applescript handler does not seem to be passed back to the Unix shell script.
man osascript
osascript <<ENDSCRIPT
tell application "Finder"
tell front window
update every file
end tell
end tell
ENDSCRIPT
shows up regularly in my scripts. Outputs from calls like that are sent to stderr and stdout. Backticks can be used to set variables in the shell.
_______________________________________________
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