Properties and globals, when is one more appropriate then the other?

I’m making a front end to a cli c program for my lab.

There’s a basic interface that appears with only the required info needed to execute the program at defaults.

There’s a button to drop down an advanced options panel where the user has all the program switches available to them.

I found that variables set withing the if name of theObject = “applyAdvancedSettings” conditional did not pass to the rest of the application and began reading on applescript and scope.

It appears that both property and global will accomplish what I need done (passing set variables from the advanced panel to the main app), but which is more appropriate design wise and why? Is there another option more appropriate then both these?

Have you considered using User Defaults?

Reading. I’m new to this, but this is looking like a good option. Thank you.

It sounds like he just needs to pass variables here, not store defaults values. No reason to go into the user defaults system if you don’t need to.

Properties are set at launch; globals are set during runtime. Both can be seen by all handlers in the script. If you don’t need to set the variable at launch, you can most likely just declare it as a global. If you require that the variable starts off with a certain value, declaring it as a property is probably what you need.