Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Scripting: Move files in the specified folder to the trash

Explorer ,
Jan 15, 2023 Jan 15, 2023

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-... 

 

TOPICS
Scripting
159
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 15, 2023 Jan 15, 2023
LATEST

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();
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines