Re: One for the experts: Serial Number of computer using Applescript Studio
Re: One for the experts: Serial Number of computer using Applescript Studio
- Subject: Re: One for the experts: Serial Number of computer using Applescript Studio
- From: Andrew Oliver <email@hidden>
- Date: Fri, 18 Mar 2005 01:45:38 -0800
On 3/18/05 1:13 AM, "Michelle Steiner" <email@hidden> wrote:
> On Mar 18, 2005, at 2:06 AM, Diana Murray wrote:
>
>> Is there a way of retrieving the serial number of a computer (which is
>> displayed as the last item of Hardware Overview) using Applescript
>> Studio.
>
> This works in vanilla Applescript:
>
> tell application "System Profiler"
> set foo to system profile
> paragraph 13 of foo
> end tell
>
> --> " Serial Number: <elided>"
This might work for now, but it probably won't work when Apple change the
output of System Profiler to include more information and the Serial number
moves to line 14 or 15... In other words this is guaranteed to break.
Instead you can use something more portable like;
do shell script "system_profiler SPHardwareDataType | grep Serial"
Andrew
:)
_______________________________________________
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