开发者

Modify sub key in *plist files

开发者 https://www.devze.com 2022-12-21 08:13 出处:网络
I\'m would like to modify a subkey in a plist file (i.e. \"TB Item Identifiers\"): NSNavPanelExpandedStateForSaveMode = 1;

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 Con开发者_Go百科figuration 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 ?


Use the PlistBuddy

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


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

精彩评论

暂无评论...
验证码 换一张
取 消