Save Settings/Variable Contents!! URGENT!!

Hey all! :smiley:
I am right at the end of creating my application but just found a GIANT flaw! :mad:
Ok heres how it goes:
My users have to register before they can use my application properly, they but in there name and serial and press ok. All is fine until the next time they use the app, the register window is displayed again!! :mad:

im getting the window to work like this:

set registered to "FALSE"

on launched theObject
   if registered is "FALSE" then
        set visible of window "register_now" to true
   end if
(* In another file... *)
on clicked theObject
   if name of button is "Submit" then
       set registered to "TRUE"
   end if
end on

Please help soon! :o

(PS im not on the computer with the files so i just typed that from memory, some errors!)

Browser: Safari 419.3
Operating System: Mac OS X (10.4)


what is the variable registered? A normal global or local?
The value of normal variables is not persistent. It get lost
the next time you launch the app.

Use a property instead or, much better, an user default in your pref file.

Note: You can use the native boolean constants false and true instead of the strings “FALSE” ans “TRUE”

Thanks, will try it :slight_smile:

Whats a user default in my pref file?
Will a property like:

property registered : false

get saved throught quit/relaunch?

Thanks :smiley:

Look at this thread:

It works at least in plain AppleScript, it should also in AppleScript Studio.
But I would prefer an user default