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