Copy link to clipboard
Copied
I am trying to move a file from a location to, say, my desktop. How do I do this using app.system()?
I found this thread How do I move files through Extendscript? which has started me on the right path, but I don't know AppleScript. I did a bit of searching and put this together, which appears to do nothing (ExtendScript just says Result: 256):
app.system("osascript -e 'tell application \"finder\" move POSIX file \"/path/to/file.tif\" to POSIX file \"~/Desktop\" with replacing'");
What am I doing wrong here?
Your script worked fine for me on MacOS Sierra
app.system("mv -f /Users/javier/Desktop/Delete/2016_12_09/image.jpg ~/Desktop");
If you have special characters or spaces, you will need to escape them with a "\\", like this:
app.system("mv -f /Users/javier/Desktop/Delete/2016\\ 12\\ 09/image.jpg ~/Desktop");
One of my folders is called "2016 12 09", so I have to escape those characters --> "2016\\ 12\\ 09"
You can also do it with osascript, like you initial code. You had a couple of errors, you were m
...Copy link to clipboard
Copied
I see. Yeah using getFiles on a network drive is not a good idea.
It is a shame that you can't retrieve the result from an app.system