getting U3 serial number on Mac OS X
revdev at pdslabs.net
Sat Dec 16 02:22:41 EST 2006
I decided to find a way to get a U3 drive's serial number on Mac (OS X only).
Sorry, I don't have a method for Linux but would welcome anyone's contribution
in this regard.
Here's what I came up with:
# Return a return-delimited list of all U3 device serial
# numbers currently known to the system.
switch the platform
set the itemDelimiter to "."
if the systemVersion < 10 then return empty
put 0 into x
put empty into tSerialNumberList
put shell("system_profiler -detailLevel mini") into tProfile
-- get U3 serial numbers
put lineOffset("U3 smart drive:",tProfile) into xStart
if xStart = 0 then exit repeat
put lineOffset("Serial Number:",tProfile,xStart) + xStart into xSerNum
put last word of line xSerNum of tProfile & cr after tSerialNumberList
delete line 1 to xSerNum of tProfile
delete last char of tSerialNumberList
More information about the Use-livecode