Copy link to clipboard
Copied
Hello everyone!
Is there any way to create and save to the desktop a file.txt containing a list with the name of all files in the specific folder with scripts?
Example:
00001.png
00002.png
00003.png
.................
.................
00300.png
Grateful for the help.
Here is an example:-
#target photoshop;
main();
function main(){
var selectedFolder = Folder.selectDialog("Please select folder");
if(selectedFolder == null) return;
var fileList= selectedFolder.getFiles("*.png");
if(fileList.length>0){
var out = new File(Folder.desktop + "/ListIcons.txt");
out.open("w");
out.encoding="UTF8";
for(var a in fileList){out.writeln(decodeURI(fileList.name));}
out.close();
}
};
Copy link to clipboard
Copied
Here is an example:-
#target photoshop;
main();
function main(){
var selectedFolder = Folder.selectDialog("Please select folder");
if(selectedFolder == null) return;
var fileList= selectedFolder.getFiles("*.png");
if(fileList.length>0){
var out = new File(Folder.desktop + "/ListIcons.txt");
out.open("w");
out.encoding="UTF8";
for(var a in fileList){out.writeln(decodeURI(fileList.name));}
out.close();
}
};
Copy link to clipboard
Copied
Sensational! Worked perfectly.
Thank you SuperMerlin