title: How to change directory with spaces in applescript terminal?
body: <p>I'm new to applescripts and I'm trying to automate a process, but how do you change directory through the script when there are spaces inside the directory? My commands should be correct but a syntax error keeps popping up:</p>
  
  <pre><code>Expected “"” but found unknown token.
  </code></pre>
  
  <p>Here is my script:</p>
  
  <pre><code>tell application "Terminal"
  activate
  do script "cd ~/Pictures/iPhoto\ Library"
  end tell
  </code></pre>
  
  <p>I don't understand where it is wrong. It works fine on my terminal.</p>
  
  <p>Thanks a bunch guys!!</p>
  
  <p>UPDATE: this worked best!!</p>
  
  <pre><code># surround in single quotes
  tell application "Terminal"
      activate
      do script "cd  '/Users/username/Pictures/iPhoto Library'"
  end tell
  </code></pre>