osx - AppleScript Runner exit status passed back to shell script -


i need able run applescript in shell script. using "applescript runner" in order in interactive mode, dialogs etc. supported. i've got working, need exit status of applescript runner app shell, can see if there errors in script.

here shell script:

output=$(/usr/bin/osascript << eot tell application "applescript runner" script "somescript.scpt" end eot)  status=$? 

here variable $status ends exit status of osascript command (which 0 whether or not somescript.scpt ran successfully), , not exit status of app applescript runner.

does 1 know how might accomplish this?

thanks!

the -e flag prints errors stderr , default. need read stderr.

this answer might if aren't familiar that:

bash variable capture stderr , stdout separately or exit value

edit: added sample code.

error=`osascript -e 'tell app "finder" adtivate' 2>&1` echo $error 

the above on system captures error messages.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -