Skip to main content
Participant
June 6, 2023
Question

Indesign script to open all images in Photoshop

  • June 6, 2023
  • 2 replies
  • 448 views

Hello, i am looking for a indesign script that opens all images that are placed on 1 or more pages/spreads in Photoshop. We are running indesign CC 2021.

2 replies

rob day
Community Expert
Community Expert
June 6, 2023

Hi @jsaes , InDesign can communicate with Photoshop via the ExtendScript Bridgetalk object. Do you need to do more than simply open the document images?

Community Expert
June 6, 2023

Can you not open them all from the same folder? 

Typically it's a good idea if all images are copied to a folder to use - and you can use the Links panel sub menu to Copy Links to - and select a folder.

Then open all images from there.

 

You might have a very good reason for linking to different locations - but typically all images especially if making changes should be centralised and linked.

 

------

Your wish to open all in photoshop is doable. 

And it relies on whether on not the File Association for  your raster images are set to open in Photoshop - this is an Operating System level setting, you can look up File Association settings for Mac or Windows online.

 

rob day
Community Expert
Community Expert
June 6, 2023

Here’s a BridgeTalk example that opens all of a document’s linked images in Photoshop:

 

imagesToPS()

function imagesToPS(){
    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") {
                openImage(lnks[i].filePath, bt);
            } 
        };   
    } else {
        alert("No Documents Open")
        return
    }
}


/**
* Open Image in Photoshop 
* @ param Image’s file path 
* @ param Bridgetalk instance 
* return void
*/

function openImage(pa, bt){
    bt.body = psScript.toString() + "\rpsScript('"+pa+"');";
    bt.onError = function( inBT ) { alert(inBT.body); };  
    bt.onResult = function(resObj) { } 
    bt.send(1000);   

    function psScript(pa) {  
        app.bringToFront();
        open (File(pa));
        //do something
    }  
};
dublove
Legend
March 8, 2025