title: JXA: move or duplicate files
body: <p>I’m trying to do a very simple thing — move (or duplicate) a file using JavaScript for Automation introduced with OS X Yosemite.</p>
  
  <p>So far I have something like this.</p>
  
  <pre><code>finder = Application("Finder")
  
  finder.move(Path("/Users/user/Source/file.pdf"), {
      to: Path("/Users/user/Destination/file.pdf"),
      replacing: true
  })
  </code></pre>
  
  <p>The result is not great.</p>
  
  <pre><code>Error -1728: Can't get object.
  </code></pre>
  
  <p>Of course I can just use something like <code>doShellScript("mv source destination")</code> but Finder + JAX solution seems to be better.</p>