May 26, '05 09:31:00AM • Contributed by: Anonymous
[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.]
|
|
|
A set of free scripts to help manage binary plist files
May 26, '05 09:31:00AM • Contributed by: Anonymous
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.]
•
[5,142 views]
Hint Options
A set of free scripts to help manage binary plist files
The Property List Editor application is the default app associated with plist files; so you can use the following from the terminal:
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.
A set of free scripts to help manage binary plist files
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\ EditorA real PITA. From there, the "Open" and "Save" commands should work with full root access.
A set of free scripts to help manage binary plist files
Oops, my bad. Used the wrong tags. There should be backslashes before those spaces. Let's try again.
A set of free scripts to help manage binary plist files
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.
A set of free scripts to help manage binary plist files
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"
A set of free scripts to help manage binary plist files
It's easy to manipulate plist files, both binary and text, with the
defaults command. For example, defaults read com.apple.finderwill 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 read ~/Documents/somefileNote 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.
A set of free scripts to help manage binary plist files
Or;
You can use the
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 to change them back if you wish.
Change the editor from VIM to emacs/Pico/whatever
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.
A set of free scripts to help manage binary plist files
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.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
A set of free scripts to help manage binary plist files
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. |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.31 seconds |
|