• 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: Computer Serial Number
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Computer Serial Number


  • Subject: Re: Computer Serial Number
  • From: John Baltutis <email@hidden>
  • Date: Sat, 26 Jul 2008 16:35:17 -0700

> On 08-07-25, at 18:02, Randal L. Schwartz wrote:
>> Mark> do shell script "system_profiler | awk '/Serial Number:/ {print $NF;
>>exit}' "
>> do shell script "system_profiler | sed -n 's/.*Serial Number://p'"
>
> This is the first part of the call:
>
> /usr/sbin/system_profiler SPHardwareDataType
>
> because as J. Welch implied, the full path saves a lookup.
>
> Even still, if I amend your script to:
>
>	do shell script "/usr/sbin/system_profiler SPHardwareDataType | sed -
> n 's/.*Serial Number://p'"
>
> it doesn't return the correct result.

On my machine, 24" iMac 2.8 GHz w/10.5.4:

do shell script "system_profiler | awk '/Serial Number:/  {print $NF; exit}'"

do shell script "system_profiler SPHardwareDataType | sed -n 's/ Serial
Number://p'" and

do shell script "ioreg -c 'IOPlatformExpertDevice' | awk
'/IOPlatformSerialNumber/ {print $4}' | cut -b 2-12"

return the computer's serial number.
 _______________________________________________
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

  • Follow-Ups:
    • Re: Computer Serial Number
      • From: Philip Aker <email@hidden>
  • Prev by Date: Re: Why "Application" not "Bundle" default Script Editor doctype?
  • Next by Date: Re: Computer Serial Number
  • Previous by thread: Computer Serial Number
  • Next by thread: Re: Computer Serial Number
  • Index(es):
    • Date
    • Thread