Question
How to pass the control from InDesign to Bridge? (JS)
My purpose is to execute InDesign script and pass the control to Bridge and execute it´s script and then get the control back to InDesign. The #target "bridge" directive is not enough. I am looking similar to "tell application "xxx" " in AS where you can easily jump between applications.
When I am running the following lines I am getting error as I think I am still talking to InDesign instead of Bridge. The error is pointing to line after the #target "bridge" directive.
My InDesign CS2 script "ExecuteBridge.jsx" contains just following line:
app.doScript( File("Macintosh HD:ChangeColorOfLabel.jsx"))
and the file "ChangeColorOfLabel.jsx" contains the following (this works well if driven in ExtendScript editor, but gives error when saved as file to be executed):
#target "bridge"
var sels = app.document.selections;
for (var i = 0; i < sels.length; i++)
{
var thumb = sels;
var md = thumb.metadata
md.namespace = "http://ns.adobe.com/xap/1.0/";
md.Label = "Green";
}
I would be very pleased if someone could give a small sample how to pass control from one application to another using JS.
regards
Erkki
When I am running the following lines I am getting error as I think I am still talking to InDesign instead of Bridge. The error is pointing to line after the #target "bridge" directive.
My InDesign CS2 script "ExecuteBridge.jsx" contains just following line:
app.doScript( File("Macintosh HD:ChangeColorOfLabel.jsx"))
and the file "ChangeColorOfLabel.jsx" contains the following (this works well if driven in ExtendScript editor, but gives error when saved as file to be executed):
#target "bridge"
var sels = app.document.selections;
for (var i = 0; i < sels.length; i++)
{
var thumb = sels;
var md = thumb.metadata
md.namespace = "http://ns.adobe.com/xap/1.0/";
md.Label = "Green";
}
I would be very pleased if someone could give a small sample how to pass control from one application to another using JS.
regards
Erkki
