3

I'm trying to open and edit a preferences file: com.apple.launchservices.plist. When I try to open the file in Sublime Text 3 it appears compiled or garbled.


How do I get it to open in the plain text XML format so I can edit it?

When I view the file using Quicklook it appears correct but I can't edit the file that way.

File opened with Sublime File previewed with QuickLook

2

As I recall from my OS X days, some .plist files are pre-tokenized or -parsed binary files. Quicklook apparently knows how to tell the difference, and un-tokenizes it before showing it to you; whereas a generic text editor like Sublime Text will load the raw contents.

Try loading the same file into another generic text editor, such as 'vim', and see if you don't get the same results.

Also: See the man page for the plutil(1) command, which does the conversion.

3
  • 3
    The solution I found was a Sublime plugin called Binary Plist. – davidcondrey May 30 '15 at 6:27
  • You can write this as a separate answer. – Skeleton Bow Jun 27 '17 at 15:55
  • The answer by Jerry T below should be the accepted answer. – frakman1 Jan 16 at 21:19
1

I would like to suggest converting the plist file to a readable xml using the following command.

plutil -convert xml1 com.apple.yourfilename.plist

And that's it. You can now open, view and edit the plist file from your Sublime or any other text editor.

1

install this package to auto convert binary plist when reading and writing: https://github.com/tyrone-sudeium/st3-binaryplist

install step: in sublimetext 3 menu: Tool>Command Palette>Type package control::install package>Type binary plist

Vola!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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