• 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: About This Mac
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: About This Mac


  • Subject: Re: About This Mac
  • From: Rhon Fitzwater <email@hidden>
  • Date: Thu, 20 Oct 2005 10:41:50 -0400

Bill et all,

Thank you very much for your help. I was aware of the system_profiler command, and I have used it in the past. My intentions of the posting to the list was to try and see how others are getting this information, or if there was a good way to get the information from the About This Mac window already formated...

I ended up using the code below to get the information I needed.

set p to do shell script "/usr/sbin/system_profiler - detailLevel mini" --using detailLevel mini will speed the command up a little
set AppleScript's text item delimiters to "System Version: "
set sysVer to paragraph 1 of (text item 2 of p)
set AppleScript's text item delimiters to "CPU Speed: "
set cpuSpeed to paragraph 1 of (text item 2 of p)
set AppleScript's text item delimiters to "CPU Type: "
set cpuType to paragraph 1 of (text item 2 of p)
set AppleScript's text item delimiters to "Memory: "
set memAmount to paragraph 1 of (text item 2 of p)
set AppleScript's text item delimiters to "("
set OSversion to (text item 1 of sysVer)
set buildVersion to (text item 2 of sysVer)
set AppleScript's text item delimiters to ")"
set buildVersion to (text item 1 of buildVersion)
set AppleScript's text item delimiters to " "


set contents of text field "version" of box "system" of statusPanel to (text item 4 of OSversion)
set contents of text field "build" of box "system" of statusPanel to buildVersion
set contents of text field "processor" of box "system" of statusPanel to cpuSpeed & " " & cpuType
set contents of text field "memory" of box "system" of statusPanel to memAmount


Hopefully this code will be useful to others.

Thanks to everyone who replied.

-Rhon

On Oct 20, 2005, at 10:02 AM, Bill White wrote:

On 10/19/05 9:52 PM, Rhon Fitzwater <email@hidden> wrote:


I would like to have a window in my application include the same
information that the About this Mac windows shows.
I.E:
System Version: 10.4.2
Build Number: 8C46
Processor: 1.5 GHz PowerPC G4
Memory: 1.25 GB DDR SDRAM

How can I get the information?

Thanks in advance,

-Rhon


Rhon,

I notice nobody seems to want to give you a concrete answer. Something like
the following should get you basically what you're after, although you'll
have to fiddle a bit to get the format exactly as you want it:


set p to do shell script "system_profiler"

set AppleScript's text item delimiters to "System Version: "

set sysVer to paragraph 1 of (text item 2 of p)

set AppleScript's text item delimiters to "CPU Speed: "

set cpuSpeed to paragraph 1 of (text item 2 of p)

set AppleScript's text item delimiters to "CPU Type: "

set cpuType to paragraph 1 of (text item 2 of p)

set AppleScript's text item delimiters to "Memory: "

set memAmount to paragraph 1 of (text item 2 of p)

set AppleScript's text item delimiters to ""

return "System Version: " & sysVer & return & "Processor: " & cpuSpeed & " "
& cpuType & return & "Memory: " & memAmount -- watch line wraps here


Hope that helps,

Bill




Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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: About This Mac
      • From: Gnarlodious <email@hidden>
  • Prev by Date: Re: Convert CSV to ICal
  • Next by Date: Re: Days and hours
  • Previous by thread: Re: About This Mac
  • Next by thread: Re: About This Mac
  • Index(es):
    • Date
    • Thread