Tell me more ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I want to know all keys (property list) which available on certain domain application, as example i could list available key for com.apple.dock by entering this command:

$ defaults read com.apple.dock

but somehow the output of this command only showed the active property list key, and yet not all available key for com.apple.dock listed there.

Anyone can help me on this? Thanks.

share|improve this question
You could also diff the output of defaults read to find the keys for normal preferences, run strings on the binaries of frameworks, or use the CFPreferencesCopyValue method in gdb. See How to explore more defaults write tweaks on OS X? - Super User. – Lauri Ranta Aug 26 '12 at 19:29

3 Answers

up vote 3 down vote accepted

There really isn't a notion of "available" keys. The application is free to read whatever keys it wants. Most people discover "secret" defaults keys by using strings to look through the application binary to see what keys it will try to read.

share|improve this answer
yes, this is exactly that i want to find, "secret" defaults keys. Could you explain further about "secret" key? It very helpful if there any example. Thank you very much. – wongacid Aug 4 '11 at 8:22
1  
Many well-known examples are listed at secrets.blacktree.com – jtbandes Aug 4 '11 at 8:38
Thanks!! let me know if you had any other great link on this kind of info. :-) – wongacid Aug 4 '11 at 15:19

As far as I know an application will only store a new key if it differs from it's defaults, at least that's what my apps do. This is not something that can be controlled easily as it is part of the User Defaults framework, as the app only tell user defaults what it needs stored and it takes care of the rest. I don't think that the information you are looking for is going to be easily obtained, sadly. It could be nice though to have access to this.

share|improve this answer

Perhaps a fairly long explanation how things work might clear up your and others' search for these "hidden" preferences.

Most applications will read their preference files once when they start and the defaults tool exists to ensure the preference files are a valid structure and don't contain syntax errors. (It also allows the system to change how the keys are stored and people don't have to know the implementation details and can use the defaults command to do all the reading and writing.)

English language style and grammar guides ensure the words I type here are meaningful to the average english speaker, and standardizing the defaults system sets a framework so everyone knows what to expect. The preference list formatting is far more rigid and mathematical than a human language, but the concepts are similar.

The the Mac OS X user defaults system is a key value store (or database if you prefer).

You can write anything into these preference key value stores, a Shakespeare sonnet, numbers, a shopping list. If the program is coded to look for a specific key, it will read the value stored. If it's not looking for that key - it's value sits there unused and unread.

This brings up how to know what values a specific program might be looking for when they start up. It boils down to you either have to know the value or reverse-engineer the program.

Since this is a user site - we'll leave the programming details of reverse engineering a Mac OS X binary for the fine folks at http://stackoverflow.com/

Many tools exist to look into a program and try to figure out what strings (the keys) are embedded, but as far as users, we ask on discussion boards, read if Apple releases this information in response to a question or a request for some new functionality.

In practice, some things that are needed for testing are added in this "hidden" way so that you can't look over the program's preference pane and see these new features that are not ready for broad use. In a way, it's not at all simple to get a comprehensive list unless the author of that program releases the source code or otherwise documents these settings publicly.

When you read the defaults store for a particular app - you are just reading the "book" that was written when the app created it's default set or the settings that shipped with the Mac OS X. That is why you don't receive the exhaustive list of things that are realistically possible to change with that application.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.