• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Calling Applescript from Unix Shell scripts
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Calling Applescript from Unix Shell scripts


  • Subject: Re: Calling Applescript from Unix Shell scripts
  • From: Doug McNutt <email@hidden>
  • Date: Fri, 27 Jul 2007 12:50:30 -0600

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.


--

--> From the U S of A, the only socialist country that refuses to admit it. <--
 _______________________________________________
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

  • Follow-Ups:
    • Re: Calling Applescript from Unix Shell scripts
      • From: email@hidden
References: 
 >Calling Applescript from Unix Shell scripts (From: email@hidden)

  • Prev by Date: Re: AppleScript-Users Digest, Vol 4, Issue 350
  • Next by Date: Re: AppleScript-Users Digest, Vol 4, Issue 351
  • Previous by thread: Calling Applescript from Unix Shell scripts
  • Next by thread: Re: Calling Applescript from Unix Shell scripts
  • Index(es):
    • Date
    • Thread