Rép: About This Mac
Rép: About This Mac
- Subject: Rép: About This Mac
- From: Yvan KOENIG <email@hidden>
- Date: Thu, 20 Oct 2005 18:26:50 +0200
Le 20 oct. 2005 , à 16:41, Rhon Fitzwater a écrit :
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.
Hello Rhon
Thanks for your duty .
it remind me a recent sentence written by Christopher NEBEL:
" In the case of the months, these happen to be the English
abbreviations, because English-speaking programmers created them."
With the standard AppleScript code,
tell application "System Profiler"
set pro to system profile
quit
end tell -- to system profiler
it was boring because the code returns a localised description:
"Matériel:
Informations matériel:
Modèle d’ordinateur: Power Mac G5
Type de processeur: PowerPC 970 (2.2)
Nombre de processeurs: 2
Vitesse du processeur: 2 GHz
Cache de niveau 2 (par processeur): 512 Ko
Mémoire: 2 Go
Vitesse du bus: 1 GHz
Version ROM de démarrage: 5.1.4f0
Numéro de série: CKxxxxxxxxx
Logiciel:
Vue d’ensemble du logiciel système:
Version du système: Mac OS X 10.3.9 (7W98)
Version Kernel: Darwin 7.9.0
Volume de démarrage: Macintosh HD
Nom de l’ordinateur: Ordinateur de Yvan KOENIG
Nom de l’utilisateur: Yvan KOENIG (yvankoenig)
Réseau:
Ethernet intégré:
Interface: ppp0
Type: PPP (PPPoE)
Adresse IP: (\"80.170.75.236\")
Adresse de destination: (\"80.170.0.1\")
Adresse du routeur: 80.170.0.1
Serveurs DNS: (\"212.151.136.242\", \"212.247.156.70\")
Adresse Ethernet: 00:0a:**********
Mémoire:
DIMM0/J11:
Taille: 512 Mo
Type: DDR SDRAM
Vitesse: PC3200U-30330
DIMM1/J12:
Taille: 512 Mo
Type: DDR SDRAM
Vitesse: PC3200U-30330
DIMM2/J13:
Taille: 512 Mo
Type: DDR SDRAM
Vitesse: PC3200U-30440
DIMM3/J14:
Taille: 512 Mo
Type: DDR SDRAM
Vitesse: PC3200U-30440
DIMM4/J41:
Taille: Vide
Type: Vide
Vitesse: Vide
DIMM5/J42:
Taille: Vide
Type: Vide
Vitesse: Vide
DIMM6/J43:
Taille: Vide
Type: Vide
Vitesse: Vide
DIMM7/J44:
Taille: Vide
Type: Vide
Vitesse: Vide
Cartes PCI/AGP:
ATY,RV350:
Type: display
Bus: AGP
Logement: SLOT-1
VRAM (totale): 64 Mo
Fabricant: ATI (0x1002)
ID du périphérique: 0x4150
Révision ID: 0x0000
Révision ROM: 113-A13601-126
Affichage:
Type: display
Type de moniteur: CRT
VRAM (utilisée): 64 Mo
Résolution: 1600 x 1200 @ 85 Hz
Profondeur: Couleurs 32 bits
Moniteur principal: Oui
Miroir: Désactivé
Connecté: Oui
Deciphering is OK but if the script is passed to someone using an other
language, it is useless.
Yours returns an english description despite the language setting of
the system.
So, your script is running fine worldwide.
Due to that, I wish to say THANK YOU !!
Yvan KOENIG
_______________________________________________
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