Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

A set of free scripts to help manage binary plist files UNIX
I wrote some free Perl scripts to help those who like using the command line deal with Apple's binary .plist file format that is omnipresent in Tiger.

[robg adds: I tested these, and they work quite well. Binary plist files are much faster, according to the documentation, but it's definitely more of a pain to work with them in the Terminal.]
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[5,142 views]  

A set of free scripts to help manage binary plist files | 10 comments | Create New Account
Click here to return to the 'A set of free scripts to help manage binary plist files' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A set of free scripts to help manage binary plist files
Authored by: stephendv on May 26, '05 11:43:13AM
The Property List Editor application is the default app associated with plist files; so you can use the following from the terminal:
sudo open /path/to/file.plist
One thing I've noticed is that I get a permissions error when choosing 'save' - even if I use sudo and even if I have full write permission to the file - but using 'save as...' works just fine.

[ Reply to This | # ]
A set of free scripts to help manage binary plist files
Authored by: danielj7 on May 26, '05 12:46:44PM
Yeah, for this to work you need to run the Property List Editor executable directly with sudo; you can't use open. Like so:
sudo /Developer/Applications/Utilities/Property\ List\ Editor.app/Contents/MacOS/Property\ List\ Editor
A real PITA. From there, the "Open" and "Save" commands should work with full root access.

[ Reply to This | # ]
A set of free scripts to help manage binary plist files
Authored by: danielj7 on May 26, '05 12:50:32PM
Oops, my bad. Used the wrong tags. There should be backslashes before those spaces. Let's try again.
 sudo /Developer/Applications/Utilities/Property\ List\ Editor.app/Contents/MacOS/Property\ List\ Editor


[ Reply to This | # ]
A set of free scripts to help manage binary plist files
Authored by: maddys_daddy on May 26, '05 10:12:38PM

Alternatively (although this is outside of the terminal, which I believe was the original spirit of the OP), Quicksilver has a "Launch as Root" action. So you open Quicksilver, type "prop", (plist editor is at the top of the list by just typing these 4 letters), hit tab, type "root", and the "Launch as Root" action shows up. Hitting enter results in the administrator password prompt, and viola, plist editor with root priveleges. May sound like alot of typing and steps, but it's really quite fluid and fast, especially once you become adept at using QS, and it's certainly faster than opening the terminal (if it's not already), and typing in the entire path. Absolutely indispensable.



[ Reply to This | # ]
A set of free scripts to help manage binary plist files
Authored by: gullevek on May 27, '05 08:24:26AM

if you don't find "launch as root" you need to activate this action in quicksilver. Launch Preferences, select Actions, select Files & Folders and tick "Launch as Root"



[ Reply to This | # ]
A set of free scripts to help manage binary plist files
Authored by: danielj7 on May 26, '05 12:35:54PM
It's easy to manipulate plist files, both binary and text, with the defaults command. For example,
defaults read com.apple.finder
will list the contents of the Finder's preferences. You can then use defaults write to modify the contents. defaults find searches all preference files for a given string.

What people often don't realize is that you can also give defaults a full pathname in order to work with arbitrary plist files, like

defaults read ~/Documents/somefile
Note that you must leave off the ".plist" extension. Be sure to read man defaults for details on all of it's features, as it has many.

[ Reply to This | # ]
A set of free scripts to help manage binary plist files
Authored by: stevanreese on May 26, '05 02:12:10PM
Or; You can use the
plutil -convert xml1 com.xxx.plist
to change the .plist file back into xml. The system doesn't seem to care which format the files are in, and when they are rewriten by the app or system then they will be changed back to binary1. Use
plutil -convert binary1 com.xxx.plist
to change them back if you wish.

[ Reply to This | # ]
Change the editor from VIM to emacs/Pico/whatever
Authored by: Gabhlan on May 27, '05 02:45:54AM

Simply open the pledit script in your actual favourite editor and change the command "vim" to "emacs" or "pico" or whatever command you use t launch your editor. It's on the eighth line from the bottom, the long one.

---
-
Gabhlan



[ Reply to This | # ]
A set of free scripts to help manage binary plist files
Authored by: kholburn on May 29, '05 08:09:02PM
I had a look at these scripts and there are some things I really don't like about them:
1) The installer puts them in /usr/bin, not /usr/local/bin meaning they could get wiped in a system upgrade.
2) They use perl when it's hardly necessary.
3) They don't use any perl checking when they could easily.
4) pledit had an uninitialised variable.
5) The edit command does not use mktemp and could be a potential vulnerability (alright in a hazardous environment, but why not write it right)
6) Once in the editor you can't get out of it and the file gets written anyway.
I made a shell script which fixes those things here. No installer, you put it where you like (say on your path) and make symbolic links to it with different names:
cp plcat ~/bin
cd ~/bin
ln -s plcat pledit
ln -s plcat plmore
ln -s plcat plless




[ Reply to This | # ]
A set of free scripts to help manage binary plist files
Authored by: SSteve on Jun 23, '05 04:45:15PM

Thanks for the improved script. I installed it and it works fine except for one minor issue. When I run plless or plmore, after the last line of the file is the message "/dev/stdout: Operation not supported". But it doesn't seem to have any detrimental effects.

I'm running Tiger 10.4.1.



[ Reply to This | # ]