• 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: Exporting shell variables to AppleScripts
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Exporting shell variables to AppleScripts


  • Subject: Re: Exporting shell variables to AppleScripts
  • From: "Mark J. Reed" <email@hidden>
  • Date: Wed, 19 Sep 2007 23:13:19 -0400

On 9/19/07, Steve Hayman <email@hidden> wrote:
>
> On 19-Sep-07, at 9:45 PM, Mark J. Reed wrote:
>
> > I wouldn't want envariables to show up as AppleScript variables.  Ugh.
> >  Unpredictable namespace pollution = bad.
> >
>
> It's already there courtesy of "system attribute". You can use
>
>         system attribute "ENVVARNAME"
>
> to retrieve the value of an environment variable.

Oh!  well, there ya go.  Problem solved.

The namespace pollution I was talking about, however, would be if
every AppleScript had a predefined variable HOME equal to the
environment variable by that name, etc, etc.  The use of "system
attribute" avoids that sort of problem.

Is there any way to modify the system attributes in-place, so that the
environment variables passed to "do shell script" are different
(without having to prepend them to the script itself)?


Also you could do your osascript demo in one line:

FOO=BAR osascript -e 'system attribute "FOO"'

No export required and FOO is only set for the osascript process,
staying untouched in the parent shell.



--
Mark J. Reed <email@hidden>
 _______________________________________________
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: Exporting shell variables to AppleScripts
      • From: Doug McNutt <email@hidden>
References: 
 >Exporting shell variables to AppleScripts (From: Mike <email@hidden>)
 >Re: Exporting shell variables to AppleScripts (From: Brian Johnson <email@hidden>)
 >Re: Exporting shell variables to AppleScripts (From: "Mark J. Reed" <email@hidden>)
 >Re: Exporting shell variables to AppleScripts (From: Steve Hayman <email@hidden>)

  • Prev by Date: Re: Exporting shell variables to AppleScripts
  • Next by Date: Re: Exporting shell variables to AppleScripts
  • Previous by thread: Re: Exporting shell variables to AppleScripts
  • Next by thread: Re: Exporting shell variables to AppleScripts
  • Index(es):
    • Date
    • Thread