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

Need a script for InDesign that runs a batch process to adjust my photos in photoshop.

Explorer ,
Sep 25, 2023 Sep 25, 2023

Is there a script for InDesign that will open all my images in photoshop - run a batch process I have made to convert all images, adjust the levels, save and close. I know I can do it in photoshop almost just as quick and them update the links in InDesign, but wondered if it could be done to save a few minutes work.

TOPICS
Import and export , Scripting
422
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
Community Expert ,
Sep 25, 2023 Sep 25, 2023

It could be written using BridgeTalk, but you're probably better off just packaging the INDD file and running the batch process on that packaged folder. Not aware of any existing solution.

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
Community Expert ,
Sep 25, 2023 Sep 25, 2023

Hi @Matthew5C62 , Here’s a Bridgetalk example that will open any image links into Photoshop and run an action—edit the doAction line as needed.:

 

 

 

 



adjustImages()

var np;
function adjustImages(){
    var bt = new BridgeTalk();  
    bt.target = "photoshop"; 
    if (app.documents.length > 0) {
        var lnks = app.documents[0].links;
        for (var i = 0; i < lnks.length; i++){
            if (lnks[i].parent.constructor.name == "Image"  ) {
                runAction(lnks[i].filePath, bt)
                while (lnks[i].status != LinkStatus.NORMAL) {lnks[i].update()}
            }
        };   
    } else {
        alert("No Documents Open")
        return
    }
}


/**
* Run an Action on open image
* @ param Link’s file path 
* @ param Bridgetalk instance 
* return new file path 
*/

function runAction(pa, bt){
    bt.body = psScript.toString() + "\rpsScript('"+pa+"');";
    bt.onError = function( inBT ) { alert(inBT.body); };  
    bt.onResult = function(resObj) { 
       np = resObj.body
    } 
    bt.send(1000); 
    function psScript(pa) {  
        app.bringToFront();
        var of = open (File(pa));
        //edit this line to your action and its group, string is case sensitive must be exact.
        doAction ("ACTION NAME", "ACTION GROUP");
        try {
            of.close(SaveOptions.SAVECHANGES);
        }catch(e) {}  
        
        return pa     
    }  
};


  

 

 

 

 

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 ,
Sep 25, 2023 Sep 25, 2023
LATEST
Thanks, I will give it a try.
—
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