title: Adding applications to dock through terminal
body: <p>I'm managing multiple computers and want to send out a script that will run in terminal that will add certain applications to the dock.  The code I am trying is </p>
  
  <pre><code>defaults write com.apple.dock persistent-apps -array-add '&lt;dict&gt;&lt;key&gt;tile-data&lt;/key&gt;&lt;dict&gt;    &lt;key&gt;file-data&lt;/key&gt;&lt;dict&gt;&lt;key&gt;_CFURLString&lt;/key&gt;&lt;string&gt;/Macintosh HD/Applications/Google Chrome.app/&lt;/string&gt;&lt;key&gt;_CFURLStringType&lt;/key&gt;&lt;integer&gt;0&lt;/integer&gt;&lt;/dict&gt;&lt;/dict&gt;&lt;/dict&gt;'
  killall Dock;
  </code></pre>
  
  <p>I have also tried</p>
  
  <pre><code>defaults write com.apple.dock persistent-apps -array-add '&lt;dict&gt;&lt;key&gt;tile-data&lt;/key&gt;&lt;dict&gt;&lt;key&gt;file-data&lt;/key&gt;&lt;dict&gt;&lt;key&gt;_CFURLString&lt;/key&gt;&lt;string&gt;/Applications/Google Chrome.app/&lt;/string&gt;&lt;key&gt;_CFURLStringType&lt;/key&gt;&lt;integer&gt;0&lt;/integer&gt;&lt;/dict&gt;&lt;/dict&gt;&lt;/dict&gt;'
  killall Dock;
  </code></pre>
  
  <p>with and without spaces in between Google Chrome.  Thanks for any help in advance.</p>