Open a window in Bridge

General Discussion of Scripting for Adobe Bridge

Moderators: Tom, Kukurykus

pierrelabbe

Open a window in Bridge

Post by pierrelabbe »

Hi,
I started in scripting.
I would like to create a script that opens a new window in Bridge with a folder of my choice (folder on the desktop).
This window must have a personal workspace (e.g. mySpace).
I've seen something like this on the forum but it did not work. It's always the Desktop that opened in Bridge.
This script must appear by Right click on the Content panel.
Thx.
Pierre
Paul MR

Open a window in Bridge

Post by Paul MR »

"mySpace" workspace must exist, hope this is a start for you Pierre.
Code: Select all#target bridge   
   if( BridgeTalk.appName == "bridge" ) { 
newBridgeWindow = new MenuElement("command", "New Bridge Window", "at the end of Thumbnail");
}
newBridgeWindow .onSelect = function () {
     openNewBridgeWindow();
     }
function openNewBridgeWindow(){
var folder = Folder.selectDialog("Please select required folder",app.document.presentationPath);
if(folder != null){
app.browseTo(folder);
for(var a in app.workspaces){
   if (app.workspaces[a].name == "mySpace"){
      app.document.setWorkspace ("mySpace");
      }
   }}
}
pierrelabbe

Open a window in Bridge

Post by pierrelabbe »

Hi Paul,

Thanks a lot, It works fine.
I wrote
var folder = Folder(Folder.desktop +"/MyFolder");
instead of
var folder = Folder.selectDialog("Please select required folder",app.document.presentationPath);


Did you know if I can choose a workspace to apply it to the window?
Mike Hale

Open a window in Bridge

Post by Mike Hale »

You do something like this...

Code: Select allapp.document.setWorkspace( "mike" );// name of workspace
Paul MR

Open a window in Bridge

Post by Paul MR »

You could try this...
Code: Select all#target bridge   
   if( BridgeTalk.appName == "bridge" ) { 
newBridgeWindow = new MenuElement("command", "New Bridge Window", "at the end of Thumbnail");
}
newBridgeWindow .onSelect = function () {
     openNewBridgeWindow();
     }
function openNewBridgeWindow(){
var dlg=
"dialog{text:'Script Interface',bounds:[100,100,500,270],"+
"panel0:Panel{bounds:[10,10,390,160] , text:'' ,properties:{borderStyle:'sunken',su1PanelCoordinates:true},"+
"statictext1:StaticText{bounds:[80,10,330,40] , text:'Window Selector' ,properties:{scrolling:undefined,multiline:undefined}},"+
"panel1:Panel{bounds:[10,50,370,110] , text:'' ,properties:{borderStyle:'etched',su1PanelCoordinates:true},"+
"statictext2:StaticText{bounds:[10,10,300,27] , text:'Please select WorkSpace' ,properties:{scrolling:undefined,multiline:undefined}},"+
"wSpace:DropDownList{bounds:[10,30,340,50]}},"+
"Process:Button{bounds:[10,120,170,141] , text:'Process' },"+
"button1:Button{bounds:[210,120,370,141] , text:'Cancel' }}};"
var win = new Window(dlg,'WorkSpace');
win.center();
for(var a in app.workspaces){
   win.panel0.panel1.wSpace.add("item",app.workspaces[a].name);   
   }
win.panel0.panel1.wSpace.selection=0;
win.panel0.Process.onClick = function(){
win.close(1);
var folder = Folder.selectDialog("Please select required folder", Folder(Folder.desktop +"/WAOO_FINI"));
if(folder != null){
   app.browseTo(folder);
   app.document.setWorkspace (win.panel0.panel1.wSpace.selection.text);
      }
   }
win.show();
}

pierrelabbe

Open a window in Bridge

Post by pierrelabbe »

Both work perfectly.
To impose the space, I used Mike's instruction.
I retain the other, you never know.

Thank you Paul and Mike