• 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: One for the experts: Serial Number of computer using Applescript Studio
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: One for the experts: Serial Number of computer using Applescript Studio
      • From: Neil Faiman <email@hidden>
References: 
 >Re: One for the experts: Serial Number of computer using Applescript Studio (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Re: One for the experts: Serial Number of computer using Applescript Studio
  • Next by Date: .acgi & form to send vars to an APP
  • Previous by thread: Re: One for the experts: Serial Number of computer using Applescript Studio
  • Next by thread: Re: One for the experts: Serial Number of computer using Applescript Studio
  • Index(es):
    • Date
    • Thread