Skip to main content
Participant
Jun 6, 2023 8:32 AM UTC
Question

Indesign script to open all images in Photoshop

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.

4 replies

rob day
Community Expert
Community Expert
Jun 6, 2023 1:29 PM UTC

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

Translate
Community Expert
Jun 6, 2023 8:54 AM UTC

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.

 

Translate
rob day
Community Expert
Community Expert
Jun 6, 2023 5:41 PM UTC

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
    }  
};
Translate
dublove
Legend
Mar 8, 2025 5:30 PM UTC

Translate