Skip to main content
Participant
December 22, 2020
Answered

Adobe Bridge scritp - Open path/folder in Bridge using javascript

  • December 22, 2020
  • 1 reply
  • 784 views

At the end of the script execution, I need to open the created folder in Bridge.

Opens the selected folder, file:

app.document.chooseMenuItem('Open');

Opens a folder in the system explorer:

Folder(myPath).execute();

Opens a folder in a new Bridge window:

app.browseTo(myPath);

How can I open the folder/path in Bridge in the same window using javascript?

 

 

    This topic has been closed for replies.
    Correct answer BarlaeDC

    Hi,

     

    You should be able to use this code :

     

    app.document.presentationPath = "/Path/Goes/Here"
    

     

     

    Malcolm

    1 reply

    BarlaeDC
    Community Expert
    BarlaeDCCommunity ExpertCorrect answer
    Community Expert
    January 6, 2021

    Hi,

     

    You should be able to use this code :

     

    app.document.presentationPath = "/Path/Goes/Here"
    

     

     

    Malcolm

    Participant
    January 7, 2021

    This is not exactly what I wanted.
    In Bridge, the script creates a folder and, after creation, enters it by opening it in the "Content" window.

    I found a solution like this:

     

    app.document.thumbnail = new Thumbnail(new Folder(myProjectFolder));

     

    But right after this line, all open folders in the "Folders" window are roll up, I don't need that. And I compelled to set a delay for Bridge to update its list (thumbnail), since the created folder is not immediately displayed.

     

    var myGo = app.scheduleTask("checkVisibleThumb()", 250, true);
    
    var checkVisibleThumbCounter = 0;
    
    var saveFirstResultVisibleThumb = app.document.visibleThumbnails.length;
    
    checkVisibleThumb = function() {
      if( checkVisibleThumbCounter >= 6 || app.document.visibleThumbnails.length > saveFirstResultVisibleThumb) {
      app.document.thumbnail = new Thumbnail(new Folder(myProjectFolder));
      checkVisibleThumbCounter = 0;
      app.cancelTask(myGo);
      }
      // +1
      checkVisibleThumbCounter++;
    }

     

    But maybe there is a better solution.