title: AppleScript error "Can’t make \"" into type integer." number -1700
body: <p>I know this error has been covered here but I have been searching through the answers for days now and when I think I have cracked it I end up breaking the code somewhere else.</p>
  
  <p>I am trying to run AppleScript in Xcode to make a backup of a folder on a set network machine.</p>
  
  <p>The problem I am having is that the backup is date stamped and in a sub folder on the users Desktop.
  I am trying to avoid using hard POSIX paths to make the final app universal.
  All the solutions I have found don't take this in to account.</p>
  
  <p>I apologize for the messy code but I am still learning AppleScript and so end up hashing different bits of code together. my code is</p>
  
  <pre><code>set catFolder to "Catalyst AA"
  set bckup to "Backups"
  set myDesktop to path to desktop folder as alias
  set main_folder to ((path to desktop folder) &amp; "Backups") as string
  
  tell application "Finder"
  if not (exists folder (bckup) in myDesktop) then
      set main_folder to (make new folder at desktop with properties {name:bckup}) as      alias
  else
  
      if not (exists folder (catFolder) in main_folder) then
          set cat_folder to (make new folder at folder main_folder with properties {name:catFolder}) as alias
      end if
  end if
  
  end tell
  
  
  
  try
  mount volume "afp://10.0.0.1/Content SSD AA/Catalyst/Catalyst 4.40_m373_HD"
  
  set d to (year of (current date) as text) &amp; "-" &amp; (month of (current date) as integer as text) &amp; "-" &amp; (day of (current date) as text) &amp; "-" &amp; (time string of (current date))
  tell application "Finder"
      set f to make new folder at POSIX file "~/Desktop/Backups/Catalyst AA" with properties {name:d}
      duplicate POSIX file "/Volumes/Content SSD AA/Catalyst" to f
  end tell
  try
      tell application "Finder"
          eject disk "Content SSD AA"
      end tell
  end try
  end try
  </code></pre>
  
  <p>the error file is</p>
  
  <pre><code>tell application "Finder"
  path to desktop as alias
      --&gt; alias "Macintosh HD:Users:ben:Desktop:"
  path to desktop
      --&gt; alias "Macintosh HD:Users:ben:Desktop:"
  exists folder "Backups" of alias "Macintosh HD:Users:ben:Desktop:"
      --&gt; true
  Result:
  error "Can’t make \"Catalyst AA\" into type integer." number -1700 from "Catalyst AA" to   integer
  </code></pre>
  
  <p>I appreciate it if someone can point out where I'm going wrong.</p>
  
  <p>Thanks for your time</p>
  
  <p>Ben</p>