Re: Display Model Name
Re: Display Model Name
- Subject: Re: Display Model Name
- From: Christopher Stone <email@hidden>
- Date: Wed, 14 Sep 2011 18:20:06 -0500
On Sep 14, 2011, at 15:35, Jeffrey Madson wrote: Here is my script and error message below. Any suggestions would be greatly appreciated.
______________________________________________________________________
Hey Jeffrey,
If you simply run 'system info' in the Applescript Editor you can see that there is not an available ModelName item in Lion or apparently Snow Leopard.
I think Stan probably has the quickest solution, and here's an easy way to parse out the model name:
# Keeping the hardware data record: set hardwareData to do shell script "system_profiler SPHardwareDataType" without altering line endings set cmd to "sed -nE '/Model Name/p' <<< " & quoted form of hardwareData & " | sed -E 's/^ +//'" set macModel to do shell script cmd
# One-liner: set macModel to do shell script "system_profiler SPHardwareDataType | sed -nE '/Model Name/p'| sed -E 's/^ +//'"
-- Best Regards, Chris
|
_______________________________________________
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