Skip navigation
NateO12
Currently Being Moderated

Bridgetalk InDesign CS3 to Illustrator CS5?

Apr 24, 2012 12:56 PM

Is it possible to have these two programs communicate? Or will I have to use strictly the CS3 programs or CS5 programs? I simply want to click on a link in InDesign and have it open in Illustrator so I can edit it. Everything I've read hasn't really touched on interoperabilty of Bridgetalk between CS versions. Thanks.

 

Nate

 
Replies
  • John Hawkinson
    5,572 posts
    Jun 25, 2009
    Currently Being Moderated
    Apr 24, 2012 10:19 PM   in reply to NateO12

    Well, you don't need Bridgetalk for that. You can File.execute() the path, or you could use VB or Applescript.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 25, 2012 2:20 AM   in reply to John Hawkinson

    or just… link.editOriginal(); I don't see what the script is doing that the contextural menu don't?

     
    |
    Mark as:
  • John Hawkinson
    5,572 posts
    Jun 25, 2009
    Currently Being Moderated
    Apr 25, 2012 6:01 AM   in reply to NateO12

    Sorry, I didn't understand you wanted to open in a non-default app.

    File.execute() has the same problem, it is functinoally equivalent to editOriginal() (though the file need not be a link).

     

    You'll have to use BridgeTalk, VB, or AppleScript.

     

    In re BridgeTalk, have you tested it? I think that's what you should do instead of asking if it works...

     
    |
    Mark as:
  • John Hawkinson
    5,572 posts
    Jun 25, 2009
    Currently Being Moderated
    Apr 25, 2012 6:12 AM   in reply to NateO12

    I'm saying no such thing.

    I've never tried it, and BridgeTalk doesn't get a huge amount of love.

    Why don't you just use VB or AppleScript? THey are comparatively

    easy.

    What OS?

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 25, 2012 7:58 AM   in reply to NateO12

    I've never tried it myself, but BridgeTalk is supposed to default to the same version as the sender if possible, otherwise the highest available version number.

     

    If you have multiple versions, you can add version number to the target.

     

    Something like (JS)

     

    var bt = new BridgeTalk()

    bt.target = "illustrator-13.0"; // (I think that's the correct version for CS3, but am really guessing)

     

     

    Let us all know if it works!

     

    Regards

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 25, 2012 8:51 AM   in reply to Bob Stucky

    The OP wants CS5 illustrator from CS3 indesign… so may not need the specifiler…? still sounds the same a using edit with from the contextural menu? but I don't have mixed versions installed so I don't know what id would list?

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 25, 2012 1:17 PM   in reply to NateO12

    Nate, Im at home now where my little mac has CS2 & CS5… This opened a selected PDF in AI CS5 from ID CS2 ( if it was already running )… If AI CS5 was not running bridgetalk did NOT launch it like I would normally expect… The message just queues until I launch it… Strange? I tested with both versions of AI running too and it was OK. I had the PDF selected with the direct selection tool…

     

     

    #target indesign
     
    indesignMain();
     
    function indesignMain() {
      
              if ( app.documents.length == 0 ) { return; }
              var doc, pdfPath, sel, script;
              doc = app.activeDocument, sel = doc.selection;
              if ( sel.length == 1 ) {
                        pdfPath = decodeURI( sel[0].itemLink.filePath );
                        script = illustratorEditPDF;
                        script += '\rillustratorEditPDF("' + pdfPath + '");';
                        btMessaging( 'illustrator-15.0', script );
              }else{
                        alert( 'Have 1 item selected?' );
              };
      
    };
     
    function btMessaging( targetApp, script ) {
     
              var bt = new BridgeTalk();
              bt.target = targetApp;
              bt.body = script;
              //bt.onResult = function( inBT ) {};
              //bt.onError = function( inBT ) {};
              bt.send( 5 );
     
    };
     
    function illustratorEditPDF( pdf ) {
      
              var doc, uIL;
              uIL = app.userInteractionLevel; 
              app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
              app.preferences.PDFFileOptions.pDFCropToBox = PDFBoxType.PDFMEDIABOX;
              app.preferences.PDFFileOptions.pageToOpen = 1;
              doc = app.open( File( pdf ), DocumentColorSpace.CMYK );
              app.userInteractionLevel = uIL;
      
    }; 
    
     
    |
    Mark as:
  • Currently Being Moderated
    Apr 26, 2012 8:43 AM   in reply to NateO12

    Im at work where I don't have 2 installs… It was a little weird for me in that if AI CS5 was not already running the message did not launch like it should… Just sat waiting I thing… When I did launch AI it open the file right away…? Odd… I commented out the call backs as they crashed my id every time… How I check this stuff is use…

     

    $.write( script );
    

     

    Just before the bt.send( 5 ); If the console result cut and paste to a new ESTK window = working script script = functionName; just strings it?. I find it easier in most cases to just pass a whole script as one string…

     
    |
    Mark as:
  • John Hawkinson
    5,572 posts
    Jun 25, 2009
    Currently Being Moderated
    Apr 26, 2012 8:46 AM   in reply to NateO12

    One thing that seemed strange is that it never enters the illustratorEditPDF function, but I'm not 100% sure on how BridgeTalk uses the line 'script = xxxxx' so perhaps that is normal.

    This is normal. The function is never evaluated. Instead, it is converted to a string and that string is passed via BridgeTalk.

     

    I feel guilty for trying to test it but I think VB would be way easier I would do it with AppleScript...

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 26, 2012 9:24 AM   in reply to NateO12

    When you check the result string yes do set the appropriate target… I'd have to check on the path thing… John I too would do this in AppleScript…

     
    |
    Mark as:
  • John Hawkinson
    5,572 posts
    Jun 25, 2009
    Currently Being Moderated
    Apr 26, 2012 9:35 AM   in reply to NateO12

     

    illustratorEditPDF("C:\test\ro1jr1xs.31g.PDF");undefined
    

     

    If I try running that as a standalone script, I get errors about the UserInteractionLevel (probably because the target is InDesign still?). BUT, if I paste the result into ESTK CS5, change the target to be Illustrator 5, change the back slashes to forward slashes in the file path, and run it, it opens the file in Illustrator properly. Do I have to do something with the slashes in the the main script then?

    At a minimum, you must double backslashes in string literals. Because Javascript interprets "\t" as a tab character. So you'll need "C:\\test\\roljrlxs.31g.PDF".

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 26, 2012 11:11 AM   in reply to NateO12

    Try this way… Again it worked here…

     

    #target indesign
     
    indesignMain();
     
    function indesignMain() {
      
              if ( app.documents.length == 0 ) { return; }
              var doc, pdfPath, sel, script;
              doc = app.activeDocument, sel = doc.selection;
              if ( sel.length == 1 ) {
                        pdfPath = File( sel[0].itemLink.filePath );
                        script = illustratorEditPDF;
                        script += '\rillustratorEditPDF(' + pdfPath.toSource() + ');';
                        btMessaging( 'illustrator-15.0', script );
              }else{
                        alert( 'Have 1 item selected?' );
              };
      
    };
     
    function btMessaging( targetApp, script ) {
     
              var bt = new BridgeTalk();
              bt.target = targetApp;
              bt.body = script;
              bt.send( 5 );
     
    };
     
    function illustratorEditPDF( pdf ) {
      
              var doc, uIL;
              uIL = app.userInteractionLevel; 
              app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
              app.preferences.PDFFileOptions.pDFCropToBox = PDFBoxType.PDFMEDIABOX;
              app.preferences.PDFFileOptions.pageToOpen = 1;
              doc = app.open( File( pdf ), DocumentColorSpace.CMYK );
              doc.bringToFront();
              app.userInteractionLevel = uIL;
      
    };
    
     
    |
    Mark as:
  • Currently Being Moderated
    Apr 26, 2012 1:06 PM   in reply to NateO12

    The problem is more likely in my script… I don't have a PC to test anything with… ( not that I would know how to switch it on, sorry )

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points