Name
system attribute
Synopsis
gestalt and environment variables
gestalt and environment variables
Returns the value of gestalt selectors (see http://developer.apple.com/documentation/Carbon/Reference/Gestalt_Manager/index.html ).
Example
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 & "!"
Also returns the value of user environment
variables (see Chapter 25 for an example
). To find out what they are, issue the system attribute
command with no parameters.
Example
system attribute "SHELL" -- "/bin/bash"
Get AppleScript: The Definitive Guide, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.