November 2003
Beginner to intermediate
480 pages
15h 3m
English
system attribute — gestalt and environment variables
Returns the value of gestalt selectors.
set n to system attribute "sysv" set s to "print sprintf \"%lx\", " & n set v to do shell script "perl -e " & quoted form of s set L to characters of v set v to "." & item -1 of L set v to "." & item -2 of L & v set v to ((items 1 thru -3 of L) as string) & v display dialog "You are running system " & v & "!"
For a list of gestalt selectors, see http://developer.apple.com/techpubs/macosx/Carbon/oss/GestaltManager/Gestalt_Manager/gestalt_refchap/ConstantsIndex.html.
Also returns the value of user environment variables. To find out
what they are, give the system attribute command
with no parameters.
system attribute "SHELL" -- "/bin/tcsh"For an example of the system attribute command used to fetch an environment variable, see Chapter 23.
Read now
Unlock full access