On the Mac, it is possible to use a shell command that reads the serial number from the system profile.
Instead of a serial number for the computer, you could interrogate the volume serial number, for example.
Thank you for your replies, Mark and SparkOut. The reason why I wanted to get the user's serial number registered was to script so that if my app was copied and run on another computer, and the serial numbers didn't match, then the app wouldn't open.
As Mark pointed out, some earler machines might not have a serial number, etc; I'm revisiting preferences info to distinguish which computer the app was registered on, so that if the software was run on another computer, matching saved info in the stack with the absence of a preferences file would be a good way to know that the software is being run on another computer.
(I'd point out, in a Read Me file, that if a user changes computers, that the software would need to be re-registered).
OK, preferences files; I've had a few "fights" with different preferences code form different people, not able to get any to work (my lack of understanding; preferences files code have always slightly confused me for some unknown reason...).
Mark, I've finally got some of your code to work (which you posted in a previous thread) but can't put the info back into fields:
Code: Select all
on mouseUp pMouseBtnNo
savePrefs
end mouseUp
global gPrefsVar
on savePrefs
 put gPrefsVar & cr & the cPrefsProp of stack "Untitled 2" & cr &\
"Whatever information you want" & cr & field "FieldA" \
& cr & field "FieldB" & cr & field "FieldC" into myPrefs
 put specialfolderpath("preferences") & "/ISaGo.prefs" into myFilePath
 open file myFilePath
 write myPrefs to file myFilePath
 close file myFilePath
end savePrefs
and
Code: Select all
on mouseUp pMouseBtnNo
savePrefs
end mouseUp
global gPrefsVar
on savePrefs
 put specialfolderpath("preferences") & "/ISaGo.prefs" into myFilePath
 open file myFilePath
 read from file myFilePath until EOF
 close file myFilePath
 put line 1 of it into gPrefsVar
 set the cPrefsProp of stack "Untitled 2" to line 2 of it
 return line 3 of it -- "Whatever information...."
---I've added these lines, but it doesn't work......
put line 3 of URL "file:ISaGo.prefs" into field "FieldD"
put line 4 of URL "file:ISaGo.prefs" into field "FieldA"
put line 5 of URL "file:ISaGo.prefs" into field "FieldB"
end savePrefs
I'd be obliged if you or anyone else could tell me how to put the lines of data back into specific fields again please.
