Modify sub key in *plist files

I'm would like to modify a subkey in a plist file (i.e. "TB Item Identifiers"):

NSNavPanelExpandedStateForSaveMode = 1;
NSPreferencesContentSize = "{508, 413}";
NSPreferencesSelectedIndex = 6;
"NSToolbar Configuration BrowserWindowToolbarIdentifier" =     {
    "TB Display Mode" = 2;
    "TB Icon Size Mode" = 1;
    "TB Is Shown" = 1;
    "TB Item Identifiers" =         (
        BackForwardToolbarIdentifier,
        HomeToolbarIdentifier,
        InputFieldsToolbarIdentifier
    );
    "TB Size Mode" = 1;
    "TB Visibility Priority Values" =         {
        BackForwardToolbarIdentifier =             (
            999
        );
        InputFieldsToolbarIdentifier =             (
            1000
        );
    };
};

I'm using the following command in a shell script :

defaults write com.apple.file key keyvalue

So each time I want to change "TB Item Identifiers", I'm modifying the entire "NSToolbar Configuration BrowserWindowToolbarIdentifier". How to directly modify a plist sub key or a sub sub key ?

Answers


defaults write com.yourcompany.app key -dict-add subkey plistValue

Use the PlistBuddy

/usr/libexec/PlistBuddy -c "set Key:SubKey1:SubKey2:Subkey3 value" ./Path/To/Your.plist


Need Your Help

create sections in class pages with doxygen

documentation doxygen

I want to document a class that has many methods.

how can i get my added usercontrol properties from flowLayoutPanel

c# user control

I am using flowLayoutPanel and adding my custom user controls to it, I can add mu usercontrol to it but i don't know how can it use it after adding.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.