title: AppleScript Not Having Permission to Save Files
body: <p>When using Applescript to write a file to my external hardrive, it shows the following error:
  <code>The document “Untitled 2” could not be exported as “test.txt”. You don’t have permission.</code>
  My code is supposed to write a file using TextEdit, and save it as an <code>.txt</code> file. My code:</p>
  
  <pre><code>tell application "TextEdit"
  activate
  make new document
  set theDate to current date
  set text of document 1 to do shell script "curl 'www.google.com'"
  tell application "System Events" to tell process "TextEdit"
      if menu item "Make Plain Text" of menu 1 of menu bar item "Format" of menu bar 1 exists then
          keystroke "t" using {shift down, command down}
          keystroke return
      end if
  end tell
  save document 1 in "HARDRIVE:test.txt"
  end tell
  </code></pre>
  
  <p>(HARDRIVE is my external hard drive).
  Why is it causing this error? What can I do to fix it?</p>
  
  <p>Thanks</p>