Ief2 and Nigel Garvey helped me out with this little routine to find the UUID of a machine through System Profiler:
do shell script “system_profiler | grep ‘Hardware UUID’”
This can be used in a routine to assign designated software to a specific machine and thereby limiting the use of the software to authorized machines only.
And if you don’t want to wait twelve seconds or more for the result, you can limit “system_profiler”'s data gathering to just the hardware by using the “SPHardwareDataType” parameter:
do shell script "system_profiler SPHardwareDataType | grep 'Hardware UUID:'"
set uuid to text ((offset of ":" in result) + 2) thru -1 of result
I think I read some place that hardware serial numbers tend to break for odd reasons like hardware defects and hardware upgrades, and as such are not reliable for Digital Rights Managment DRM
I have an old Intel iMac (one of the 1st ones). It had the logic board replaced early on. It lost its Serial Number.* It now has “SystemSerialNumb” instead. It does not have a Hardware UUID, does not have the field. It is running 10.4.11.
So maybe Hardware UUID is a Leopard addition. I don’t know whether it can be lost. Likely someone does.
I read somewhere that if you ask, they will keep (restore) your Serial Number during these kinds of repairs. I never had any kind of problem with the machine or its (many) applications afterwards, so it seemed a moot point. Apparently applications use more intense methods. But it might matter for a homemade security method.
Yes, it also fails. There is no UUID. That machine was one of the 1st Intel iMacs. I ordered it just before they announced Intel chips in Macs, and they asked me if I wanted the new (never seen before) Intel verson.
So, after the logic board was replaced, it has that standard text as a “serial number” and was too early for a UUID. But registered software always worked on it, so I didn’t really care.