• 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: using a shell variable in an osascript line?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: using a shell variable in an osascript line?


  • Subject: Re: using a shell variable in an osascript line?
  • From: Axel Luttgens <email@hidden>
  • Date: Fri, 27 Feb 2009 17:08:13 +0100


Le 27 févr. 09 à 16:35, René v Amerongen a écrit :

[...]



If I may insert another question here?

How do I get the result 'button returned:OK' back or the Cancelled value?

Just check the return code of the osascript command: 0 if the user clicks "OK", 1 if the user has canceled.
Of course, this assumes that the osascript command won't fail for any other reason.
Alternatively, you might want to check the return code of a pipe similar to this one:
osascript -e "..." | grep ":OK"
Note that osascript seems to write the result of the AppleScript snippet to stdout, and to write messages related to AppleScript errors to stderr.


HTH,
Axel

_______________________________________________
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: using a shell variable in an osascript line?
      • From: "Mark J. Reed" <email@hidden>
References: 
 >using a shell variable in an osascript line? (From: LuKreme <email@hidden>)
 >Re: using a shell variable in an osascript line? (From: Axel Luttgens <email@hidden>)
 >Re: using a shell variable in an osascript line? (From: "Mark J. Reed" <email@hidden>)
 >Re: using a shell variable in an osascript line? (From: "Mark J. Reed" <email@hidden>)
 >Re: using a shell variable in an osascript line? (From: René v Amerongen <email@hidden>)

  • Prev by Date: Re: using a shell variable in an osascript line?
  • Next by Date: Re: using a shell variable in an osascript line?
  • Previous by thread: Re: using a shell variable in an osascript line?
  • Next by thread: Re: using a shell variable in an osascript line?
  • Index(es):
    • Date
    • Thread