Getting the Serial Number of the User's computer
Mark Talluto
userev at canelasoftware.com
Wed Dec 10 14:30:46 EST 2008
On Dec 9, 2008, at 10:59 AM, Paul Looney wrote:
> How can I retrieve the computer serial number in OS X, Vista and
> Linux from Rev?
> Thanks in advance, I appreciate it.
Hi Paul,
This is how we get the serial on OS X using shell. It is very fast
and has the added benefit of identifying refurb macs.
function getSerial
put empty into tSerial
put shell("/usr/sbin/system_profiler SPHardwareDataType")
into tResult
repeat with x=1 to the number of lines of tResult
if "Serial Number" is in line x of tResult then put
line x of tResult into tSerial
end repeat
if tSerial is not empty then put the last word of tSerial
into tSerial
if tSerial is empty then put "Refurb Mac" into tSerial
return tSerial
end getSerial
Mark Talluto
http://www.canelasoftware.com
More information about the use-livecode
mailing list