Help! please...a mac serial number related problem

I just spent over a year learning applescript on my own to write one applescript program which is now complete and functions. (The code is at the bottom of this post. It’s brief: All it does is open a pdf file and input its password - thus, it is a pdf “password-inputter”)

I have a final problem that I can’t seem to lick. If anybody out there can give me a helping hand, I would be really appreciative:

I have to write a second, separate applescript file that (a) launches the first file referred to above, (b) grabs the MAC serial number from the end-user’s machine, (c) cannot operate - that is, it cannot launch the first file - until it grabs the MAC serial number and (d) once it grabs a MAC serial number once, from the machine it’s on, it will no longer operate on another machine with another serial number.

(The reason for these two files: it will complete a security device for my pdf file. Once the second apple script file is written, my security device will be complete.) The first applescript program will have to include a statement that goes something like this: “This file can only be launched by applescript file number 2.” Can anyone point me in the right direction or even provide me with some code to do this? Thank you, very much, in advance for any help. I’d be really appreciative.

PS: My alternative is to use a separate program that grabs the MAC serial number from the user’s machine and relies on a unique identifier to operate - one that corresponds to the serial number. I actually have that program (it was given to me) but don’t even know what program it was written in and so I can’t complete it. If anyone can tell me what program this file was written in - it’s here: http://www.course-talks.com/z.html - I’d be grateful.

Again, thank you very much for any help.

Here is the code for the first applescript file referred to above:

tell application “Adobe Acrobat Pro” to activate
set thePath to ((get path to startup disk) & “Applications:” & ¬
(do shell script “echo $APPLICATIONS”) & ¬
“nevacim:2.pdf”) as string

tell application “Finder”
open alias thePath
end tell

tell application “System Events”

key code 38
key code 47
key code 4
delay 3.0
key code 36

end tell

If you are after a mac/machine specific number may be one of these will do you.

do shell script "system_profiler SPHardwareDataType | grep 'Serial Number' | awk '{print $4}'"

do shell script "system_profiler SPHardwareDataType | grep 'Hardware UUID' | awk '{print $3}'"

do shell script "system_profiler | grep 'Hardware (MAC) Address:' | awk '{print $4}'"

(Mark 67) thank you for that code - I tried all three and they produced the serial number and mac address. I will keep it for future use. Truthfully, I wish I had the skills to use it, to complete my security device. I was wondering (I’m new at this), is this too much to ask (or would the code be too complex): Is there a way to state via apple script:

“If this applescript file is used once on a machine with this serial number, this file cannot work on a machine with another mac serial number but will continue to operate on this machine with this mac serial number.”

Is that possible? If I could write that into my file, I would have a simple security device - not Fort Knox - but at least, after it’s used once, it can’t be passed it on. Thank you, very much, for considering my request…PS

Hi,

registering to a hardware serial number is disadvantageous, when the user buys a new computer
or the reference computer has been repaired by changing the mainboard.

I’d prefer a registration method like AquaticPrime, which uses an RSA encrypted plist file