• 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: Get System Info - How
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Get System Info - How


  • Subject: Re: Get System Info - How
  • From: Walter Ian Kaye <email@hidden>
  • Date: Sat, 3 Apr 2004 03:50:49 -0800

At 09:17p +1000 04/03/2004, email@hidden didst inscribe upon an electronic papyrus:

On 02/04/2004, at 2:11 PM, Bill wrote:

How would I go about getting just the "user name" or "ethernet address"
or "RAM available" etc ?

physical RAM size:
(((system attribute "ram ") div 1024 div 1024) as Unicode text) & "MB RAM"
-- "1024MB RAM"

well, this works, but only with the space after ram. why?

Because it's a Gestalt selector, which is a 32-bit -- aka 4-byte -- code.

user name:
system attribute "USER"
-- "bill"

this works without any space. additionally system atribute without any arg returns a list containing "USER" but not "ram ". again: why???

With the advent of Mac OS X and its Unix underpinnings, 'system attribute' gained functionality beyond Gestalt codes. In this particular case, USER is a Unix environment variable the same as $USER you would type at a shell prompt.

The list returned lets you know which Unix environmental variables are available via the command. Which is nice that it lets us know. :)

Just don't ask me how it knows that a 4-byte Unix env. var. is not to be treated as a Gestalt selector. Maybe Chris knows...


-boo
_______________________________________________
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.


  • Follow-Ups:
    • Re: Get System Info - How
      • From: Christopher Nebel <email@hidden>
References: 
 >Re: Get System Info - How (From: Bill <email@hidden>)
 >Re: Get System Info - How (From: email@hidden)

  • Prev by Date: Re: Get System Info - How
  • Next by Date: Re: Utility to show key codes?
  • Previous by thread: Re: Get System Info - How
  • Next by thread: Re: Get System Info - How
  • Index(es):
    • Date
    • Thread