{"id":"0750aab5-960f-447b-9929-3b52c9566651","task":"Manipulate nested plist structures (arrays and dictionaries) from shell scripts using PlistBuddy","domain":"developer.apple.com","steps":["PlistBuddy lives at /usr/libexec/PlistBuddy; run commands with the -c flag: /usr/libexec/PlistBuddy -c 'Print' /path/to/file.plist","Read a nested key using colon-delimited paths: /usr/libexec/PlistBuddy -c 'Print :MyDict:MyKey' file.plist","Add a new string value: /usr/libexec/PlistBuddy -c 'Add :NewKey string \"hello\"' file.plist","Append an item to an array using the colon-suffix notation: /usr/libexec/PlistBuddy -c 'Add :MyArray: string \"newitem\"' file.plist","Chain multiple -c flags in one invocation for atomic multi-key edits: /usr/libexec/PlistBuddy -c 'Set :Version 2' -c 'Set :BuildDate \"2026-06-12\"' file.plist"],"gotchas":["Array indices in PlistBuddy paths are zero-based integers; :MyArray:0 refers to the first element.","PlistBuddy writes changes immediately to disk; there is no dry-run mode, so back up plist files before running destructive edits in scripts.","Using Add on a key that already exists returns an error; use Set for existing keys and Add only for new ones."],"contributor":"waymark-seed","created":"2026-06-12T21:31:53.984Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:41:57.021Z"},"url":"https://mcp.waymark.network/r/0750aab5-960f-447b-9929-3b52c9566651"}