Skip to main content
Known Participant
January 15, 2023
Question

Scripting: Move files in the specified folder to the trash

  • January 15, 2023
  • 1 reply
  • 226 views

The code here stores all files on the folder where the selected footage exists in the array "trgfiles".

var folderPR = app.project.selection[0].file.fsName.replace(/\\/g,'/'); var hoge = folderPR.lastIndexOf("/"); var folderPath = folderPR.slice(0,hoge+1); var folder = new Folder(folderPath); var trgfiles = folder.getFiles();

 

I would like to create a script to move all the files in trgfiles from here to the recycle bin.
Here is the link I am referring to, but it does not work.

https://community.adobe.com/t5/photoshop-ecosystem-discussions/delete-active-document-recycle-bin/m-p/10866551?profile.language=en 

 

This topic has been closed for replies.

1 reply

Known Participant
January 15, 2023

Sorry, the code is hard to see, I will fix it.

var folderPR = app.project.selection[0].file.fsName.replace(/\\/g,'/');
var indx = folderPR.lastIndexOf("/");
var folderPath = folderPR.slice(0,indx+1);
var folder = new Folder(folderPath);
var trgfiles = folder.getFiles();