Skip to main content
dublove
Legend
May 2, 2026
Question

Is there a solution: How to open Photoshop at a specific location from the ID?

  • May 2, 2026
  • 3 replies
  • 80 views

Hi everyone ~

I have a question—I’m not sure if there’s a solution:
I have multiple versions of Photoshop, but sometimes I only want to use the version located in a specific directory.
For example, “C:\Ps2026\Photoshop.exe”.

Is there a way to use a script in InDesign to open an image using the this specific path Photoshop.exe ?

You can copy the directory containing the installed Photoshop.exe to the C drive to test it.


Thank you.

    3 replies

    rob day
    Community Expert
    Community Expert
    May 2, 2026

    Show the entire script that is throwing the error—in my script var f = open(File(pa) is on line 40 not 5

    dublove
    dubloveAuthor
    Legend
    May 2, 2026

    Hi rob day.

    I didn't change any of the code; I just copied the code you provided exactly as it was.
    Yes, based on what it says, it should be line 36.
    But it's strange—why does it say it's line 5?
     

    rob day
    Community Expert
    Community Expert
    May 2, 2026

    What does pa return if you trace it?

     

        function psScript(pa) {  
    app.bringToFront();
    alert(pa)
    var f = open (File(pa));
    //do something end close
    //f.close()
    }

     

    rob day
    Community Expert
    Community Expert
    May 2, 2026

    Hi ​@dublove and ​@Eugene Tyson , You need to use Bridgetalk in order to communicate between InDesign and Photoshop. Here is a simple BT example that opens the active InDesign document’s links. Once the PS file is open you have to use the Photoshop API in order to work on the image:

     

    //call function
    imagesToPS()

    /**
    * Open all of the doument’s linked images
    * return void
    */

    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.send(1000);

    //the photoshop script to run on the opened file
    //this function uses Photoshop’s API not InDesign’s
    function psScript(pa) {
    app.bringToFront();
    var f = open (File(pa));
    //do something end close
    //f.close()
    }
    };

     

    Community Expert
    May 2, 2026
    if (app.selection.length > 0 && app.selection[0].graphics.length > 0) {
    var imageFile = File(app.selection[0].graphics[0].itemLink.filePath);
    var photoshopExe = File("D:/ADOBE/Adobe Photoshop 2026/Photoshop.exe");

    if (photoshopExe.exists && imageFile.exists) {
    photoshopExe.execute('"' + imageFile.fsName + '"');
    } else {
    alert("Photoshop or image file was not found.");
    }
    } else {
    alert("Select a placed image first.");
    }

    This works for me - the problem is the backslashes - they’re escape characters in Javascript - so you need to use the other direction slashes.

    You could probably build a little UI with directory to different versions of Photoshop so you don’t need so many scripts - or if you just want to have Open With point to 1 version of Photoshop and the script to another.


     

    dublove
    dubloveAuthor
    Legend
    May 2, 2026

    Thank you so much!
    I’ve got something new to tinker with for a while.