title: How do I set plist values
body: <p>I am trying to change some Safari settings and am trying to use com.apple.Safari.plist for this.<br>
  These are the following key values I need to change</p>
  
  <pre><code>com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaScriptEnabled
  WebKitJavaScriptEnabled
  com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaScriptCanOpenWindowsAutomatically
  WebKitJavaScriptCanOpenWindowsAutomatically
  com.apple.Safari.ContentPageGroupIdentifier.WebKit2PluginsEnabled
  WebKitPluginsEnabled
  WebKitJavaEnabled
  </code></pre>
  
  <p>I tried changing the first one using </p>
  
  <pre><code>defaults write com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaScriptEnabled -bool true
  </code></pre>
  
  <p>It did not change values. I need some help to understand why and how to rectify that.</p>
  
  <p>And also I would like some help on how to access this value to change the string value</p>
  
  <pre><code>&lt;key&gt;ManagedPlugInPolicies&lt;/key&gt;
  &lt;dict&gt;
      &lt;key&gt;PlugInName&lt;/key&gt;
      &lt;dict&gt;
          &lt;key&gt;PlugInDisallowPromptBeforeUseDialog&lt;/key&gt;
          &lt;true/&gt;
          &lt;key&gt;PlugInFirstVisitPolicy&lt;/key&gt;
          &lt;string&gt;PlugInPolicyAllowNoSecurityRestrictions&lt;/string&gt;
      &lt;/dict&gt;
  &lt;/dict&gt;
  </code></pre>
  
  <p>How do I change the value of PlugInFirstVisitPolicy? I want to change the string to something else.</p>
  
  <p>Is there another way than defaults write. I've read about plistbuddy but am not sure how to use it. Any help is highly appreciated. Thanks.</p>
  
  <p>NOTE: I have got the first part<br>
  I used PlistBuddy to set those values how I wanted them</p>
  
  <pre><code>/usr/libexec/PlistBuddy -c "Set com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaScriptEnabled true" ~/Library/Preferences/com.apple.Safari.plist
  </code></pre>
  
  <p>And so on for other values.
  But I still don't know how to access the one within a container the second part of the question. Please Help.</p>