Separate names with a comma.
Discussion in 'Mac Programming' started by Kilamite, Feb 21, 2010.
Where about are they stored?
NSUserDefaults stores them, so they go in ~/Library/Preferences/com.yourcompany.yourproduct.plist
Thanks for reply. Checked out the plist file for Safari.
I assume that is the window size for Safari (obviously not pixels..)? Can't find anything that would suggest the actual position of the window though.
That aside, if I were have a script to swap the .plist files (say for when I change the resolution), it wouldn't exactly be the best way (but only way..?) since any changes to an application would only apply to one set of plists.
Does Safari preserve the actual position of its Preferences window?
As long as I know it is in the .plist file that's fine.
Right, so when I change resolutions, a script that swaps the .plist files for that resolution would be cool.. bit annoying it means each resolution's apps will have different preferences.
What you should do is read Apple's docs on how window positions and sizes are stored in the user-defaults plist. There is a simple way of saving this data, that works for most apps. But most apps aren't obsessed about resolution changes, a point which you've brought up twice now without explaining exactly what you're trying to do, what your app does, or why you care so much about resolution changes.
There are any number of ways to store your specific data in the user-defaults plist. These can be tailored to specific needs, but you have to read the reference docs to see how things work.
Switching plists with a script is bludgeoning the problem into submission with a very blunt weapon. You might get it to work, but it will hardly be a good use of the API.