title: Finder error: Apple event handler failed
body: <p>I am trying to write an applescript to pull a string from clipboard, parse it and create a folder if it satisfies a condition.</p>
  
  <p>The string is always of the format "yyyymmdd.hhmmss.abc.xyz"</p>
  
  <p>The code is pasted below:</p>
  
  <pre><code>set datevar to item 1 of my Splitstring(the clipboard, ".")
  set yearvar to (datevar / 10000) as integer
  
  on Splitstring(stringvar, del)
      set defaultdel to AppleScript's text item delimiters
      set AppleScript's text item delimiters to del
      set arrayvar to every text item of the stringvar
      set AppleScript's text item delimiters to defaultdel
      return arrayvar
  end Splitstring
  .
  .
  .
  .
  .
  .
  if yearvar &lt; 2002 then
      set tempvar to "/Volumes/My Passport/Cygnus-CME/Cycle-22-Min/Slow_CME/"
      set loc to POSIX path of tempvar
      tell application "Finder"
          make new folder at loc with properties {name:datevar} # ---- Error location
      end tell
  end if
  </code></pre>
  
  <p>The command to create a new folder works fine if the path is something else. I have verified that the external HD is mounted and the permissions for my account are r&amp;w.</p>
  
  <p>What am I doing wrong? Is there a problem with the way I have set the path of the external HD?</p>
  
  <p>Thank you for your help! </p>