Skip to main content
August 10, 2015
Answered

How to move a file from one folder to another with javascript?

  • August 10, 2015
  • 1 reply
  • 703 views

In my script I'm batch processing folders. Copying and editing files when necessary.

There is one folder that needs to move from it's location which is given in input, to one that is dynamically assigned via metadata in the file name.

All the other files I'm moving via the save locations and photoshop manipulations, however, this file itself doesn't need to be opened by photoshop but I was hoping there was still some way to address this in the same script.


Either via including the necessary javascript to move the file from within the photoshop jscript instance, or by executing a shell script that I can pass variables too. I'm not as certain on the possibility for the latter (passing variables that way), and I haven't found documentation for the former.

This topic has been closed for replies.
Correct answer xbytor2

Documentation for the File and Folder APIs can be found in the JavaScript Tools Guide which can be found on adobe.com.

There is a no File.move() method. You need to user File.copy() and File.remove().

An alternative is to use app.system() call and pass it a shell command that does the move.

1 reply

xbytor2Correct answer
Inspiring
August 10, 2015

Documentation for the File and Folder APIs can be found in the JavaScript Tools Guide which can be found on adobe.com.

There is a no File.move() method. You need to user File.copy() and File.remove().

An alternative is to use app.system() call and pass it a shell command that does the move.