Property is not Sticking

I’ve got a project that doesn’t seem to remember it’s properties from one launch to the next (yes, this is launching the build from the Finder, not rebuilding and running from within PB which would naturally reset the properties). For instance, the following code should work to remember window placement from one launch to the next but the window always opens to it’s default position. Any ideas?

Thanks,
Jon

Here’s an even more basic example:

Each time the app is run (again, on it’s own, not from PB), it never increments the launch_count value.

Jon

All right, I’ve solved it by using “user defaults” as detailed in “/Developer/Examples/AppleScript Studio/Archive Maker.” But shouldn’t the properties be persistent even without this?

Jon

I can’t remember where, but it is explicitly stated in the documentation that properties are not persistent outside of each run of the script.

That you have to use user defaults. I feel that this is a weakness because you only get one set of user defaults. Meaning you cannot duplicate an applescript studio application and have different settings for the duplicated application as you can with scripts.

Kevin

I have wasted 6 months or so looking for a reason, and haven’t found one. (This problem is not even specific to PB…it also shows up in the script editor.) And if properties are not retained, then there really is no need for them in the language.

I have had no problems with using properties for applets or droplets. Any applescript that doesn’t need to be run in a script editor seems to work fine. As soon as you modify the code of the script though the properties are forgotten.

Kevin

There is a problem (specific to some systems) which will not allow properties to be saved. If anyone knows what this problem is, or how to solve it, please post>

I’m not sure that what follow is related to the thread but anyway. As a newbie, I read a bunch of doc and among the mass I had read that:

<<In AppleScript Studio, script properties are not saved back into the application as they currently are in standard AppleScript scripts. Therefore the values of script properties do not persist between launches.>>

Search in the batch find of AppleScript Studio to find the full section.