-
Scripting help
Hi,
I am writing a script to move photoshop files into a specific folder but I have to press the button several times for it to move all the photoshop files. I want the function to move all the photoshop files into the folder in one click and not several. Any help is much appreciated. Below is the code –
movepsd.onClick = function (){ var psdFolder = null; for (var i = 1; i <= app.project.numItems; i++){ if ((app.project.item(i) instanceof FolderItem) && (app.project.item(i).name == "psd")){ psdFolder = app.project.item(i); break; } } if (psdFolder == null) return; for(var i = 1; i <= app.project.numItems; i++){ var splitName = app.project.item(i).name.split("."); if((app.project.item(i) instanceof FootageItem) && (splitName[splitName.length-1].toLowerCase() == "psd") || (splitName[splitName.length-1].toLowerCase() == "PSD")) app.project.item(i).parentFolder = psdFolder; } }Thanks,