24 Replies Latest reply: May 1, 2012 8:25 AM by NateO12 RSS

    Bridgetalk InDesign CS3 to Illustrator CS5?

    NateO12 Community Member

      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

        • 1. Re: Bridgetalk InDesign CS3 to Illustrator CS5?
          John Hawkinson CommunityMVP

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

          • 2. Re: Bridgetalk InDesign CS3 to Illustrator CS5?
            Muppet Mark Community Member

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

            • 3. Re: Bridgetalk InDesign CS3 to Illustrator CS5?
              NateO12 Community Member

              Well editOriginal() would open the file in Acrobat, since I'm dealing with PDFs most of the time. I was hoping to open them in Illustrator. I'd rather not change my default application preferences to have PDFs open in Illustrator every time. I guess I could use Acrobat Pro to manipulate the files.

               

              But if I wanted to do this, just to see how it's done, how would using File.execute() tell Illustrator to open the file? I'll search around a bit and see what I can find.

               

              Nate

              • 4. Re: Bridgetalk InDesign CS3 to Illustrator CS5?
                John Hawkinson CommunityMVP

                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...

                • 5. Re: Bridgetalk InDesign CS3 to Illustrator CS5?
                  NateO12 Community Member

                  Well I initially started out by searching these forums, and trying out some code that I found. Most of the code was for InDesign -> Photoshop, which was fine to make sure everything worked. However, nothing would work. It's like InDesign wasn't communicating with Photoshop. So I figured I better check here and make sure CS3 and CS5 can work together via BridgeTalk before I got too deep. But if you're saying CS3 and CS5 are capable of interaction I'll continue searching and see what I can come up with. I'm not trying to have someone write this for me, just wanted to make sure it was possible before I wasted too much time.

                   

                  Nate

                  • 6. Re: Bridgetalk InDesign CS3 to Illustrator CS5?
                    John Hawkinson CommunityMVP

                    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?

                    • 7. Re: Bridgetalk InDesign CS3 to Illustrator CS5?
                      NateO12 Community Member

                      Ah ok. Sorry, I was reading that to mean CS3 to CS5 would work.

                       

                      I'm on 32bit Windows 7, so it'd be VB. I'll do some searching and reading and see what I can find. I'll put BridgeTalk on the back burner.

                      • 8. Re: Bridgetalk InDesign CS3 to Illustrator CS5?
                        Bob Stucky Adobe Employee

                        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

                        • 9. Re: Bridgetalk InDesign CS3 to Illustrator CS5?
                          Muppet Mark Community Member

                          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?

                          • 10. Re: Bridgetalk InDesign CS3 to Illustrator CS5?
                            NateO12 Community Member

                            Mark, InDesign CS3 only has Edit Original, no Edit With. We have some software here that for the time being is only compatible with CS3 templates. Eventually that will get updated to work with CS5, so at that point this problem/script would go away. But if I can figure out a quick script to open the link in Illustrator I'm going to use that until we upgrade, instead of trying to hunt down the original art in a folder with 150,000+ files.

                             

                            Nate

                            • 11. Re: Bridgetalk InDesign CS3 to Illustrator CS5?
                              Muppet Mark Community Member

                              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;
                                
                              }; 
                              
                              • 12. Re: Bridgetalk InDesign CS3 to Illustrator CS5?
                                NateO12 Community Member

                                Wow Mark that looks great! Thank you so much. Only problem is for some reason it's not working on my machine. I've been stepping through the code to see where it might be having issues. It will run the indesignMain function, then switch to the btMessaging function, then go back to the indesignMain function and finish. I've been putting some alerts in to see if it's getting the PDF path (yes), the correct target app (yes), and the correct script to run (yes), but nothing happens in Illustrator. 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. For fun I tried running the script in ESTK CS5, and at the bottom of the window it says 'Execution finished. Result: undefined'. So now I'm wondering if something might be wrong with my machine.

                                 

                                Nate

                                • 13. Re: Bridgetalk InDesign CS3 to Illustrator CS5?
                                  Muppet Mark Community Member

                                  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…

                                  • 14. Re: Bridgetalk InDesign CS3 to Illustrator CS5?
                                    John Hawkinson CommunityMVP

                                    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...

                                    • 15. Re: Bridgetalk InDesign CS3 to Illustrator CS5?
                                      NateO12 Community Member

                                      Ok, the script to string part makes sense now. Thanks for making that make sense guys.

                                       

                                      Mark, I tried to do what I think you were talking about, (cutting and pasting the result of the console into a new ESTK window). I get this as a result in the console:

                                      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;
                                        
                                      }
                                      
                                      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?

                                      • 16. Re: Bridgetalk InDesign CS3 to Illustrator CS5?
                                        Muppet Mark Community Member

                                        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…

                                        • 17. Re: Bridgetalk InDesign CS3 to Illustrator CS5?
                                          NateO12 Community Member

                                          I would love to do this in Applescript but I'm stuck with Windows here at work. We have moved almost entirely away from Macs.

                                          • 18. Re: Bridgetalk InDesign CS3 to Illustrator CS5?
                                            John Hawkinson CommunityMVP

                                             

                                            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".

                                            • 19. Re: Bridgetalk InDesign CS3 to Illustrator CS5?
                                              Muppet Mark Community Member

                                              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;
                                                
                                              };
                                              
                                              • 20. Re: Bridgetalk InDesign CS3 to Illustrator CS5?
                                                NateO12 Community Member

                                                Still no luck. I think something is up with BridgeTalk. I changed the timeout value in bt.send(); from 5 to 45, and the script just zips right through. So since it's not waiting 45 seconds before it finishes, that must mean the target is processing the message, but not doing anything with it, right? Or perhaps the message isn't even getting to the target?

                                                 

                                                Mark, what version of ESTK are you using? I'm trying to get it to work in 2. I don't have Illustrator listed in the targets drop down though. Could that be part of the problem?

                                                • 21. Re: Bridgetalk InDesign CS3 to Illustrator CS5?
                                                  Muppet Mark Community Member

                                                  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 )

                                                  • 22. Re: Bridgetalk InDesign CS3 to Illustrator CS5?
                                                    NateO12 Community Member

                                                    I just tried the last script on an XP machine with InDesign CS2 and Illustrator CS2. I changed  'illustrator-15.0' to 12, and the script worked perfectly! So it's gotta be something specific to my machine. I'm going to try it on another Windows 7 machine tomorrow and see what happens.

                                                    • 23. Re: Bridgetalk InDesign CS3 to Illustrator CS5?
                                                      NateO12 Community Member

                                                      Works fine on another Windows 7 machine in the area. This time it was InDesign CS4 with Illustrator CS5. My machine must be messed up. Perhaps it's time for a re-image. I'm going to mark this as answered, but if I figure out what is causing my machine to not work I'll update this thread. Thanks for all the help Mark and John.

                                                      • 24. Re: Bridgetalk InDesign CS3 to Illustrator CS5?
                                                        NateO12 Community Member

                                                        I just ran

                                                        BridgeTalk.getTargets();
                                                        

                                                        in ESTK 2, and the console reports back "bridge, estoolkit, indesign, stockphotos". So for some reason it's not seeing any CS5 apps. However, when I run the same code in ESTK 5, I get "fireworks, ame, bridge, devicecentral, dreamweaver, estoolkit, exman, flash, flashcatalyst, illustrator, indesign, photoshop, stockphotots, switchboard". So there are many more choices. Not sure if that will help but I figured I should mention it.

                                                         

                                                        Nate