Re: Creating an environment variable from AppleScript
Re: Creating an environment variable from AppleScript
- Subject: Re: Creating an environment variable from AppleScript
- From: "Mark J. Reed" <email@hidden>
- Date: Fri, 6 Oct 2006 12:37:27 -0400
On 10/6/06, Philip Aker <email@hidden> wrote:
I am trying to create an environment variable with AppleScript.
OK. Why?
Environment variables, no matter how created, are only effective for
the process in which they are created (and any child processes it
creates later). In other words, every time you start a new program
(whether via AppleScript or a shell command in the Terminal or by
double-clicking an icon), it gets its very own copy of the
environment, which goes away when that program terminates. The parent
process who started the program never sees those changes. So any
modifications it makes are only visible to itself - although any
programs that *it* later starts will have those changes reflected in
their copy.
So what you're doing, essentially, is marking up a photocopy and
expecting the marks to be visible on the original. (Except you
wouldn't do that 'cause you're familiar with how photocopying works,
of course; I'm not trying to dis you here.)
The only reason I can see to set an envariable in AS would be for the
benefit of some external command that you're starting later in the
same AS script. But in that case, the appropriate thing to do is to
set them as part of the same "do shell script" command, e.g.
{ do shell script "DISPLAY=:0 xterm" }
--
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:
This email sent to email@hidden