Re: Display Model Name
Re: Display Model Name
- Subject: Re: Display Model Name
- From: Stan Cleveland <email@hidden>
- Date: Wed, 14 Sep 2011 14:04:53 -0700
On Sep 14, 2011, at 1:35 PM, Jeffrey Madson wrote: I have a script that I built two years ago with the help of several scripters from this post. The script displays some basic system information about the Mac it's running on in one easy to read window to aid the help desk. I have another piece of information I want to add to the window and this is the Model Name from the System Profiler.
Here is my script and error message below. Any suggestions would be greatly appreciated.
set macInfo to system info set ModelName to ModelName of macInfo set the end of userInfo to {"ModelName:", ModelName} as text The error I get is: error "Can’t get ModelName of {AppleScript version:\"2.1.2\", AppleScript Studio version:\"1.5.1\", system version:\"10.6.8\", short user name:\"ditjm0-local\", long user name:\"ditjm0-local\", user ID:501, user locale:\"en_US\", home directory:alias ...............
Hi Jeffrey,
In SL, the ModelName data does seem to be unavailable.
You could parse the result of the following command to get the data you need: set hardwareData to do shell script "system_profiler SPHardwareDataType"
Or even better, get the data as XML: set hardwareData to do shell script "system_profiler -xml SPHardwareDataType"
Stan C.
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden