Finding out property list (plist) attributes and/or processes

command linedefaultsplistterminal

Apple’s own web page indicates how to Edit property lists in Terminal on Mac. However is there a way to guess/find out an attribute or a process that I would like to modify but I don’t know the existence of?

In the case of the Dock position, I would have had to:

  1. Figure out that such a plist file exists (in this case com.apple.Dock.plist),
  2. Then I would have had to find the correct key (in this case orientation),
  3. Finally I would have had to find out the possible values (in this case left but right and down would also have been possible).

Then the whole command would have been (or is, in this case): defaults write com.apple.dock orientation left (then in terminal type killall Dock in order for the change to take place).

My questions:

  • If I would not have known that the dock position on the screen could be modified with the Terminal command defaults write com.apple.dock orientation left, would I have been able to figure it somehow out?
  • Is there a way to find a plist attribute or process by searching say for keywords?
  • If yes, how/with what tool?
  • Is there (or could we figure out) some kind of a step-by-step procedure to do that (preferably in Terminal)?

Best Answer

Each application can choose what to store in their plist files. The names of the keys and the different possible values are determined by the application, which can be developed by Apple or by any third party, and there is no standard.

To find different combination of keys/values usable in a plist file, you can do the following:

  1. Read the documentation. But often Apple doesn't provide full documentation.

  2. Find existing plist file and modifiy them, by deducing and trying different keys/values.

  3. Run the command strings on the executable to dump out all text. (Thanks to mmmmmm for this).

  4. Look at the source code if the application is open source, reverse engineer it otherwise.