Skip to main content
dublove
Legend
March 4, 2025
Answered

How to open images with different default applications in InDesign and resource manager (Windows)?

  • March 4, 2025
  • 5 replies
  • 3461 views

In ID, when pressing Alt+double click, I want to open jpg, tif, PSD in PS by default.

 

However, in resource manager (Windows), I would like to default to Honeyview to open jpg, psd, tif when double clicking on an image. because I find Honeyview easier to look at the image.

 

Is it possible to realize?
Thanks.

Correct answer m1b

I'm not sure why it's not working maybe @m1b has an idea - sorry I know there's more scripters but the handles are escaping me to tag them.


@Eugene Tyson this is an example of how I like to handle BridgeTalk calls. I write a function that I then convert to string using `Function.toSource()` then I call it inside an IIFE, adding parameters to the IIFE call (these must be strings too). (Edit: note that I don't actually invoke `toSource`—the function `openPaths` is impicitly coerced to a string by the `replace` method I used to construct the bt.body string.) This might seem a bit opaque at first but for me it avoids a lot of the messy string concatenation dance that goes on. It also means that I can literally test the Photoshop function `openPaths` directly in photoshop to make sure it works!

 

@dublove this is my attempt at a script to "Open Selected Images in Photoshop". It works for me on MacOS. Does it work for you on Windows?

- Mark

 

 

/**
 * @file Open Selected Links In Photoshop.js
 *
 * Opens the selected linked file(s) in Photoshop.
 *
 * @author m1b
 * @version 2025-03-08
 * @discussion https://community.adobe.com/t5/indesign-discussions/how-to-open-images-with-different-default-applications-in-indesign-and-resource-manager-windows/m-p/15197180
 */
(function () {

    if (0 === app.documents.length)
        return alert('Please open a document and try again.');

    var doc = app.activeDocument,
        items = doc.selection;

    if (0 === items.length)
        return alert('Please select a linked graphic frame and try again.');

    // collect paths for each selected item
    var paths = [];

    for (var i = 0; i < items.length; i++) {

        var item = items[i];

        // maybe user selected the image, not the frame
        if ('Image' === item.constructor.name)
            item = item.parent;

        if (
            !item.hasOwnProperty('graphics')
            || 0 === item.graphics.length
            || !item.graphics[0].itemLink
            || LinkStatus.NORMAL !== item.graphics[0].itemLink.status
        )
            // ignore anything we can't use
            continue;

        // first linked image is all we need right now
        paths.push(item.graphics[0].itemLink.filePath);

    }

    if (0 === paths.length)
        return alert('Please select a linked graphic frame and try again.');

    // open the paths in photoshop
    openPathsInPhotoshop(paths);

})();

/**
 * Opens the given `paths` in Photoshop.
 * @author m1b
 * @version 2025-03-08
 * @param {Array<String>} paths - the paths to open.
 */
function openPathsInPhotoshop(paths) {

    const DELIMITER = '###';

    var photoshop = BridgeTalk.getSpecifier("photoshop");

    if (!photoshop)
        return alert("Photoshop is not available.");

    // send script via BridgeTalk
    var bt = new BridgeTalk();
    bt.target = photoshop;

    // arrange the function inside an IIFE string,
    // and perform string replacements to insert
    // our variables
    bt.body = '(#FN#)("#P#","#D#");'
        .replace('#D#', DELIMITER)
        .replace('#P#', paths.join(DELIMITER))
        .replace('#FN#', openPaths);

    bt.onResult = undefined;
    bt.send(1000);

};

/**
 * Photoshop function to open the given `paths`.
 * Note: cannot use // style comments here because
 * of the way I stringify it.
 * @param {String} paths - the paths, delimited.
 * @param {String} delimiter - the string used to delimit `paths`.
 */
function openPaths(paths, delimiter) {

    app.bringToFront();

    /* make aray by splitting paths */
    paths = paths.split(delimiter);

    for (var i = 0; i < paths.length; i++)
        if (File(paths[i]).exists)
            app.open(File(paths[i]));

};

 

Edit 2025-03-08: fixed a bug, where I forgot to include the string delimiter. Oops!

5 replies

Inspiring
March 8, 2025

Easily with autohotkey. 

You can add a new shortcut or you can remap alt + double click  in ID.

I am using this every day. F1 will open selected file in PS,  no matter what file type is used. 

Mike Witherell
Community Expert
Community Expert
March 6, 2025

Big InDesign + Big Bridge = Big Pair of 4K monitors

Mike Witherell
Dave Creamer of IDEAS
Community Expert
Community Expert
March 7, 2025

OFF TOPIC: @Mike Witherell That image brings back memories! I started my [electronic] production career on a 512K (1/2 a MG) Mac with PageMaker 1.0. No hard drive--just the ol' floppy disk swap...

 

David Creamer: Community Expert (ACI and ACE 1995-2023)
Mike Witherell
Community Expert
Community Expert
March 7, 2025

Heh! Heh! It was so thrilling to operate early PageMaker until the floppy drive had a momentary freeze from spinning, and the whole thing crashed and you had to start all over. Pretty soon the dedicated hdd saved us from that problem. What an interesting ride this has all been, and continues to be!

Mike Witherell
Mike Witherell
Community Expert
Community Expert
March 6, 2025

That is one of the useful moments in Adobe Bridge. In Bridge preferences, you can setup filetype associations contrary to what the operating system is doing. I use Bridge as a companion to InDesign a lot.

Mike Witherell
dublove
dubloveAuthor
Legend
March 6, 2025

Bridge
Might be a great choice, except I guess I haven't liked it in all these years, maybe it's just too big.

Peter Spier
Community Expert
Community Expert
March 5, 2025

I've added a new comment to the thread @Eugene Tyson linked. It should be possible to use thast OP's original script in a scripts panel subfolder and assign a keyboard shortcut.

Community Expert
March 5, 2025

InDesign will use the systems File Association to open the image - so if you're computer is setup to open in Honeyview (whatever that is) then it will open the images from InDesign in Honeyview. 

 

A script and more info here

https://community.adobe.com/t5/indesign-discussions/script-that-opens-a-selected-indesign-image-in-photoshop/m-p/14541251

 

 

dublove
dubloveAuthor
Legend
March 6, 2025

Thank you very much.
I really didn't realize that there are others who share the same hobby as me.

 

In fact, this code still doesn't open in PS ......
Rather, it opens in the default application in windows.

 

The qualification of having to use the white arrow is a bit self defeating.

Community Expert
March 6, 2025

Try this

 

if (app.documents.length > 0 && app.selection.length > 0) {
    var sel = app.selection[0];
    var imageItem = null;
    
    // Check if the selection is directly an image
    if (sel.constructor.name === "Image") {
        imageItem = sel;
    }
    // Otherwise, if it is a rectangle (or any page item that can contain an image),
    // check if it has images inside.
    else if (sel.hasOwnProperty("images") && sel.images.length > 0) {
        imageItem = sel.images[0];
    }
    
    if (imageItem && imageItem.itemLink) {
        var filePath = imageItem.itemLink.filePath;
        openInPhotoshop(filePath);
    } else {
        alert("Please select an image or a frame that contains an image.");
    }
} else {
    alert("No document open or nothing selected.");
}

function openInPhotoshop(filePath) {
    try {
        var bt = new BridgeTalk();
        bt.target = "photoshop";
        bt.body = 'app.bringToFront(); app.open(new File("' + filePath + '"));';
        bt.send();
    } catch (e) {
        alert("Error opening image in Photoshop: " + e);
    }
}