Re: system attribute (Change computer name)
Re: system attribute (Change computer name)
- Subject: Re: system attribute (Change computer name)
- From: Christopher Nebel <email@hidden>
- Date: Wed, 23 Apr 2003 01:25:40 -0400
On Wednesday, December 31, 1969, at 07:40 PM, Jean-Baptiste LE STANG
wrote:
I naively tried the following
-> get the computer name
wich was compiled in
-> get system attribute name
which returned
-> {"HOME", "SHELL", "USER", "LANG", "PATH",
"__CF_USER_TEXT_ENCODING"}
Any explanation about this is welcome, what's the aim of 'system
attribute' ? (I must admit that I've been ignoring it for a long > time)
Interesting accidental application of synonyms. :)
"system attribute" used to live in the Finder's dictionary under the
name "computer"; it was moved to Standard Additions when Mac OS X came
out and was given a less generic (if still fairly cryptic) name. The
name "computer" was left in place as a synonym for backward
compatibility.
It used to be purely a front end to the Gestalt system call -- you can
pass it a variety of four-character codes, and it will tell you various
things about the system in terms of a 32-bit integer. The most
commonly known one is "sysv" for the system version, but there are lots
more -- see Gestalt.h in my iDisk for a reasonably up-to-date list.
In 10.1.2, it was enhanced to also deal with Unix environment variables
-- anything that doesn't match a Gestalt selector is looked up that
way. For example, 'system attribute "USER"' will give you your login
name. If you give it nothing, or something that can't be interpreted
as text, you'll get a list of all defined environment variables, which
is what happened in your last try.
--Chris Nebel
Apple Development Tools
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.