Re: Exporting shell variables to AppleScripts
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