• 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: Passing calls to an AS app via shell?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Passing calls to an AS app via shell?


  • Subject: Re: Passing calls to an AS app via shell?
  • From: Chris Espinosa <email@hidden>
  • Date: Fri, 8 Oct 2004 13:35:22 -0700

The best way to send params to an OSAScript is to set them as environment variables in the Shell, then use 'system attribute' in the AppleScript to access them:

$ export dd_string=`sw_vers -productVersion`
$ osascript -e 'set theVersion to system attribute "dd_string"' -e 'tell application "Terminal"' -e 'display dialog "Version: " & theVersion' -e 'end tell'


Note a couple of things here:
- The environment variable will only be available in the script executed from the shell. If you put the "set" above inside the "tell" block, it would come up with nothing, as it would get System Attributes in effect at the time Terminal was launched
- You can do this with applets launched from the shell, if the applet is launched with the "open" command from the shell that defines the environment variable


Chris

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Passing calls to an AS app via shell?
      • From: Christopher Nebel <email@hidden>
References: 
 >Re: Passing calls to an AS app via shell? (From: Johnny AppleScript <email@hidden>)
 >Re: Passing calls to an AS app via shell? (From: Joshua See <email@hidden>)

  • Prev by Date: Re: Choose folder dialog and then process contents?
  • Next by Date: Change desktop iPhoto alb.
  • Previous by thread: Re: Passing calls to an AS app via shell?
  • Next by thread: Re: Passing calls to an AS app via shell?
  • Index(es):
    • Date
    • Thread