Hi, you can use following snippet that you needs to run separately. When you run this script, you have to choose folder where all jpg file exists. This script will create folder "Folder A" and "Folder B" for files less than or equal to 200KB and larger than 200 KB, respectively. Folder A and Folder B will be created inside the folder that you will choose. This is not may be exact answer that is required by you, but after running photoshop action, you can run this following script to filter the images based on sizes.
function main() {
var folder = Folder.selectDialog("Select Folder");
var files = folder.getFiles("*jpg");
var smallFilesFolder = Folder(folder.fsName + "/Folder A");
if (!smallFilesFolder.exists) {
smallFilesFolder.create();
}
var largeFilesFolder = Folder(folder.fsName + "/Folder B");
if (!largeFilesFolder.exists) {
largeFilesFolder.create();
}
var len = files.length
for (var i = 0; i < len; i++) {
var _file = files[i];
if (_file instanceof File) {
if (_file.length <= 200000) { // less than equal to 200 KB
_file.copy(smallFilesFolder + "/" + _file.name);
} else if (_file.length > 200000) { // greater than 200 KB
_file.copy(largeFilesFolder + "/" + _file.name);
}
_file.remove();
}
}
}
main();
I hope this helps you in an indirect way.
Thanks