• 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: Creating an environment variable from AppleScript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: Creating an environment variable from AppleScript
      • From: Philip Aker <email@hidden>
References: 
 >Creating an environment variable from AppleScript (From: "Kumar Shailove" <email@hidden>)
 >Re: Creating an environment variable from AppleScript (From: Philip Aker <email@hidden>)

  • Prev by Date: Re: Creating an environment variable from AppleScript
  • Next by Date: Re: Creating an environment variable from AppleScript
  • Previous by thread: Re: Creating an environment variable from AppleScript
  • Next by thread: Re: Creating an environment variable from AppleScript
  • Index(es):
    • Date
    • Thread