I must be insane, User Defaults across OS X versions

OK, I know that’s a catchy topic…but here’s my dilemma.
I am working on an application which reads and writes from users defaults. However, depending on the version of OS X it detects during the startup process, it either displays the “Parent Window (Tiger)” or a “Panther Window” and uses a different script. Oddly, it seems that the .plist file doesn’t get created on startup when the app is launched under Panther, and only gets created when the application quits. In looking at the .plist, none of the defaults set in the Panther Window" appear, and all of the defaults from the Tiger window are there. It seems that the defaults system is tied to a specifc script or a specific window. Is it possible to read and write to defaults from a secondary script or from a secondary window?

OK, I figured this one out myself. Turns out, I was writing preferences during the “should quit” handler, and that was overwriting what the “Panther” window wrote to the preference file. Everything’s working well with the user defaults now, on OS X 10.4 and 10.3.