title: Backup a folder using Applescript
body: <p>I'm new to Applescript, and am trying to put together a simple script to backup some folders when it is run. My script is as follows:</p>
  
  <pre><code>on run
      tell application "Finder"
          set backupFolder to make new folder at "BACKUP" with properties {name:(year of (current date) as string) &amp; "-" &amp; (month of (current date) as integer as string) &amp; "-" &amp; (day of (current date) as string)}
          duplicate folder "~/Test" to backupFolder
      end tell
  end run
  </code></pre>
  
  <p>However, when I run the script I recieve an error stating that:</p>
  
  <pre><code>Finder got an error: Can’t set folder "2013-1-9" of disk "BACKUP" to folder "~/Test".
  </code></pre>
  
  <p>This seems like such a trivial problem, but I can't work out how to fix it. Would anyone be able to let me know what am I doing wrong?</p>