Find serial number (or other unique number)

is there a way to get the serial number of the computer that the script is running on. or get a number that would be unique to each computer.


“2 questions” does nothing for people who search by topic. Make another topic for your other question.

Edit: Thanks.

sorry about that. i just thought i would post it in one topic rather than making 2.

Serial Number of a machine:

set SN to last word of paragraph -2 of (do shell script "system_profiler SPHardwareDataType")

nice! thanks man.

Adam, that returns “Enabled” for me. This work for me though:

do shell script "/usr/sbin/system_profiler SPHardwareDataType | /usr/bin/grep 'Serial Number' | /usr/bin/grep -o '[[:alnum:]]*$'"

Edit: That’s because I have additional hardware. :slight_smile: