Thread View: adobe.scripting.indesign
6 messages
6 total messages
Started by Jim_Huddle
Mon, 23 Mar 2009 21:47
Need help [JS]: select images/captions in InD, switch to Bridge and write to XMP
Author: Jim_Huddle
Date: Mon, 23 Mar 2009 21:47
Date: Mon, 23 Mar 2009 21:47
5 lines
1137 bytes
1137 bytes
Not sure of the right place to post this. . but i'm writing a Javascript in InDesign. Part of the script sends a script object into Bridge, but nothing's happening in Bridge. The script works when I test each module but i can't get it to work in concert. Can someone help? See the link below. . . <http://www.adobeforums.com/webx/.59b862e0> Thanks
Re: Need help [JS]: select images/captions in InD, switch to Bridge and write to XMP
Author: Bob Stucky
Date: Mon, 23 Mar 2009 22:05
Date: Mon, 23 Mar 2009 22:05
16 lines
966 bytes
966 bytes
Jim,
You likely have an error in the script you're sending to Bridge.
add onResult and onError handlers to the bridgeTalk message:
bt.onResult() {
alert( "Done!" );
}
bt.onError( msg ) {
alert( "Error: " + msg.body );
}
That will tell you where to look in the script sent to Bridge.
Bob
Re: Need help [JS]: select images/captions in InD, switch to Bridge and write to XMP
Author: Jim_Huddle
Date: Mon, 23 Mar 2009 23:39
Date: Mon, 23 Mar 2009 23:39
4 lines
867 bytes
867 bytes
Bob thanks much! Hmm I put the handlers in after the bt.body command and before the bt.send. . . and it tells me that it expects a ";" on the first open brace in the new text. Any ideas?
Re: Need help [JS]: select images/captions in InD, switch to Bridge and write to XMP
Author: Bob Stucky
Date: Tue, 24 Mar 2009 13:35
Date: Tue, 24 Mar 2009 13:35
19 lines
1140 bytes
1140 bytes
It's a syntax error in the script you're sending to bridge.
Write the function like this:
myRemoteFunction = function() {
this.requiredContext = "Needs to run in Bridge, with a selection of a file, ideally with some metadata";
...
}
Without all the myScript += "..." stuff.
Then run the script in Bridge from the ESTK. Once it's debugged then
myScript = myRemoteFunction.toString();
myScript += "myRemoteFunction();\n";
That's a lot easier that what you're doing now.
Bob
Re: Need help [JS]: select images/captions in InD, switch to Bridge and write to XMP
Author: xbytor
Date: Tue, 24 Mar 2009 15:49
Date: Tue, 24 Mar 2009 15:49
8 lines
962 bytes
962 bytes
> myScript = myRemoteFunction.toString(); Hey Bob, Is there any real difference between using toString() vs toSource() in this context? I've acquired the habit of doing toSource() for this. -X
Re: Need help [JS]: select images/captions in InD, switch to Bridge and write to XMP
Author: Bob Stucky
Date: Tue, 24 Mar 2009 16:06
Date: Tue, 24 Mar 2009 16:06
3 lines
717 bytes
717 bytes
Not really. I've acquired the habit of using toString() Bob
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads