我正在尝试做一件非常简单的事情——使用随 OS X Yosemite 引入的自动化 JavaScript 移动(或复制)文件。
到目前为止,我有这样的事情。
finder = Application("Finder")
finder.move(Path("/Users/user/Source/file.pdf"), {
to: Path("/Users/user/Destination/file.pdf"),
replacing: true
})
结果不是很好。
Error -1728: Can't get object.
当然,我可以使用类似的东西,doShellScript("mv source destination")
但 Finder + JAX 解决方案似乎更好。