2

I've opened /System/Library/Frameworks/AppKit.framework/Resources/StandardKeyBinding.dict in vim, and it looks like jibberish. Is there a way to convert it to human readable just to see what it contains?

3

If you have plutil installed

You can run this Applescript which will create a text version of the dictionary for you to read.

   property copyScriptPath : "~/Documents/" (* path dir for text version*)

tell application "Finder"
    set selectFiles to (get selection) (* get the finder selection*)
end tell
repeat with i from 1 to number of items in selectFiles
    (* convert to POSIX path*)
    set this_item to quoted form of POSIX path of (item i of selectFiles as alias)


    (* get the file name , add it to an alias, then use plutil to read and write atext version out using the original name*)
    do shell script "name=`basename " & this_item & "`;/usr/bin/plutil -convert xml1  " & this_item & " -o  " & copyScriptPath & "\"$name\".txt"
end repeat

OR

There is an old hint on macosxhints - 10.4: Edit binary (and normal) plist files with vim

The post also has the link to the vim script that does all this.

Which may do what you want. ( don't use vim myself )

Quote from the post ( But please go and read it as there are comments and notes that you will need:

What does it do? It reads a plist file, checks and memorizes if it is binary, converts it to plain text if necessary and turns on syntax highlinghting for XML. When you save the file again, it is converted to binary again for writing if it was binary in the beginning. If the file was not binary or if the conversion to binary fails (which can happen if you have syntax errors in your file), the file is stored in text format. If an originally-binary plist is saved as plain text due to syntax errors and you fix the errors and save the file again, it is written in binary format. If you open a binary file and just view it without making any changes, you can still exit from vim using the normal :q (no need for :q!) and the file is left untouched (still in binary format). All this should work even when working with several buffers (files), when reading a file into an existing buffer, or when only writing parts of a buffer to file


0

Here is the method to make StandardKeyBinding.dict file correctly readable:

plutil -convert xml1 StandardKeyBinding.dict

No use to convert it back.

  • 1
    You mean no need to convert it back? – trusktr Nov 9 '14 at 1:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .