Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uunet!iconsys!caeco!jose!ken From: ken@jose.uucp (Ken MacLeod) Newsgroups: comp.sys.mac.programmer Subject: Re: Saving user preferences Summary: That's a feature... Message-ID: <1989Nov16.174625.6378@jose.uucp> Date: 16 Nov 89 17:46:25 GMT References: <5542@unix.SRI.COM> Organization: Price Savers, Salt Lake City, UT Lines: 40 In article <5542@unix.SRI.COM>, gil@ginger.sri.com (Gil Porat) writes: >What is a clean and user-transparent scheme for storing an >application's user settable preferences (e.g. English vs Metric)? One is a "Notepad" which is a pseudo-document (and the icon is marked by the lower-left corner folded up, instead of the upper-right folded down). The only difference between a notepad and a document, to the user, is that the document opens up "Unnamed" and must be "Save as..."'d. This allows for templates, "type of document" preferences, etc., and keeps the preferences in each document. I believe I heard mumblings somewhere that multifinder, a newer finder, or a "pseudo-application" (to go with the pseudo-docs :-) was created to handle notepads entirely outside of applications. A real document can be taken and marked as a "notepad created by NotePad-App", NotePad-App is launched when the icon is double-clicked, it asks for a new name, copies the notepad to the new name, marks the new file back to the original doc type, and launchs the real app with the new file. Consistent to the user and transparent _to_you_! :-) >This scheme doesn't seem that user-transparent because >the preferences file usually manifests itself as an icon. >The user might accidentally delete it, rename it, etc... Then again, they might do it purposely, "That's a feature." It enables one to have different sets of preferences for different purposes (I'll use metric when doing things for A, but English for B) by merely changing file names and to purposely delete them in a manner _consistent_ with the rest of the Mac. You could put an explicit rename-, pick- and clear- preferences menu items, but why clutter up your application menus with something the finder already handles well? I highly recommend notepads, store the preferences in each document. If the "preferences" are somewhat large, like macros, functions (as in callable macros, not necessarily compiled C, of course :-), style/template definitions, etc., then the document can contain the name of the notepad (or path if we've "Save as..."'d in into another folder). If you can't find the notepad immediately upon opening, throw up an "Open..." dialog: "I can't find notepad XXX, please locate it", like HyperCard does when it can't find a stack.