script to batch resize, convert to CMYK within sub folders

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

kevinless

script to batch resize, convert to CMYK within sub folders

Post by kevinless »

hi

can anyone assist in a script that can automate rescaling pictures to smaller sizes and at the same time converting from rgb to cmyk, NOTE: all pictures are within sub folder hierarchies on mac osx

thanks

Professional AI Audio Generation within Adobe Premiere Pro - Download Free Plugin here

pfaffenbichler

script to batch resize, convert to CMYK within sub folders

Post by pfaffenbichler »

This should help with the first step, getting the files from folders in a folder.
As for the rest of the stuff how well versed are you with JavaScript and Photoshop’s DOM and have you done a Forum search here and over at
https://forums.adobe.com/community/phot ... ng/content ... ng/content
for the various operations you want to combine?
Code: Select allvar theFolder = Folder.selectDialog ("select folder");
var theFolderFiles = retrieveTIFandPSD (theFolder, []) ;
alert (theFolderFiles.length+"\n\n"+theFolderFiles.join("\r"));
////// get from subfolders //////
function retrieveTIFandPSD (theFolder, theFiles) {
   if (!theFiles) {var theFiles = []};
   var theContent = theFolder.getFiles();
   for (var n = 0; n < theContent.length; n++) {
      var theObject = theContent[n];
      if (theObject.constructor.name == "Folder") {
         theFiles = retrieveTIFandPSD(theObject, theFiles)
         };
      if (theObject.name.slice(-4) == ".tif" || theObject.name.slice(-4) == ".psd") {
         theFiles = theFiles.concat(theObject)
         }
      };
   return theFiles
   };