title: Applescript - If file is in folder don't duplicate
body: <p>I'm trying to test if a file from on folder path, exists in a different folder using this script:</p>
  
  <pre><code>set middfilesECON211 to ("/Volumes/middfiles/Classes/Spring14/ECON0211B/HANDOUTS" as POSIX file)
  set gDriveECON211 to ("/Users/paolob/Google Drive/Spring 2014/ECON 211/Handouts" as POSIX file)
  
  tell application "Finder"
     set foo to every file of folder middfilesECON211
     repeat with i from 1 to (length of foo)
         if not (exists (item i of foo) is in files of folder gDriveECON211) then
           duplicate (item i of foo) to gDriveECON211
         end if
     end repeat
  end tell
  </code></pre>
  
  <p>I've tried a bunch of variation in the <code>if not (exists) ...</code> clause, but to no avail.</p>