Skip to main content
Harbs.
Legend
October 28, 2007
Question

How to access script from within Bridge

  • October 28, 2007
  • 1 reply
  • 722 views
I have considerable experience scripting InDesign, but this is my first
Bridge script...

The following script does what I want from within the ESTK, but I have
no idea what to do to make it runnable from within Bridge... :(


Any pointers?

var brSel = app.document.selections[0].spec.toString();
var bt = new BridgeTalk();
//brSel = brSel.toSource();
bt.target = "indesign";
theScript = "var IDsel = app.selection[0]; \n";
theScript += "if (IDsel instanceof Graphic){ \n";
theScript += "var theGraphic = IDsel;\n";
theScript += "}else{\n";
theScript += "var theGraphic = IDsel.graphics[0];\n";
theScript += "}\n";
theScript += "var theFile = File(\""+brSel+"\");\n";
theScript += "theGraphic.itemLink.relink(theFile);\n";
theScript += "theGraphic.itemLink.update();\n";
bt.body=theScript;
bt.send()

Thanks,
Harbs
This topic has been closed for replies.

1 reply

October 28, 2007
Harbs,

There isn't anything like a scripts palette in Bridge.

Because your working on a selection, you'll need to add a menu item to bridge.

You can also navigate to the folder containing the scripts and double click it. But then the script is the selection...

Bob
Harbs.
Harbs.Author
Legend
October 28, 2007
Hi Bob.

Thanks for the response. I noticed there was no script pallete, but I'm
trying to get my head around the Bridge approach to scripting...

I found the add menu and add context menu scripts. They helped a lot.

Thanks.

Harbs