33 Replies Latest reply on Jul 7, 2010 1:17 AM by Kasyan Servetsky

    How to communicate with Acrobat from InDesign

    Kasyan Servetsky Level 5

      Yesterday Loic asked me for an example of a script that would send the pdf file by mail.

      Today I made it and decided to post it here on the forum — may be this will be interesting to somebody.

      It exports the frontmost document to pdf file using [Smallest File Size] preset, then opens it in acrobat, sends it in the attachment to this e-mail address: someone@somewhere.com (please change it) and finally closes the file.

      I tested it on CS3 for Windows, but I can't send e-mails from my Mac. Can anybody test it on Mac?

       

      Kasyan

       

      #target indesign
      var myIndesignDoc = app.activeDocument;
      var myParentFolder = myIndesignDoc.fullName.parent;
      var myBaseName = GetFileNameOnly(myIndesignDoc.name);
      var myFilePath = myParentFolder.absoluteURI + "/" + myBaseName + ".pdf";
      var myFile= new File(myFilePath); 
      myIndesignDoc.exportFile( ExportFormat.pdfType, myFile, false, "[Smallest File Size]" );
      
      var myScript = AcrobatScript.toString() + '\r';
      myScript += 'AcrobatScript(\"' + myFilePath + '\");'; 
      var bt = new BridgeTalk;
      bt.target = "acrobat";
      bt.body = myScript;
      bt.send();
      
      function AcrobatScript(myFilePath) {
           var myAcrobatDoc = app.openDoc(myFilePath);
           myAcrobatDoc.mailDoc({
                bUI: false, // don't show dialog box
                cTo: "someone@somewhere.com", // e-mail address 
                cSubject: "This message was sent you by script", // subject line
                cMsg: "Here goes some message text."// message body
           });
           myAcrobatDoc.closeDoc( true );
      }
      
      function GetFileNameOnly(myFileName) {
           var myString = "";
           var myResult = myFileName.lastIndexOf(".");
           if (myResult == -1) {
                myString = myFileName;
           }
           else {
                myString = myFileName.substr(0, myResult);
           }
           return myString;
      }
      
        • 1. Re: How to communicate with Acrobat from InDesign
          SuperMacGuy Level 2

          I can't seem to make it work. It produces a PDF but then I don't see any activity or emailing it seems.

          CS3 and Acro 8 and Acro 9

          • 2. Re: How to communicate with Acrobat from InDesign
            Kasyan Servetsky Level 5

            I've found the reason why it doesn't work on Mac:  Acrobat is not a messaging-enabled application on Mac ( it is on Windows).

            You can test it by running this line:

            BridgeTalk.getSpecifier("acrobat");
            ==> acrobat-8.0 -- on Windows

            ==> null -- on Mac

             

            or you can get the list of messaging-enabled application:

            BridgeTalk.getTargets();

            on Windows,  Acrobat is in the list:

            acrobat,bridge,devicecentral,dreamweaver,estoolkit,illustrator,indesign,photoshop,stockpho tos

            but on Mac, it's missing

            • 3. Re: How to communicate with Acrobat from InDesign
              Peter Kahrel Adobe Community Professional & MVP

              Kasyan,

               

              Thanks for sharing this useful script. However, I can't get it to work because apparently Acrobat doesn't like my email program. After the PDF is created and loaded in Acrobat, nothing happens. When I try to attach the PDF manually (File > Attach to Email), Acrobat says ""Acrobat is unable to connect to your email program." I've poked around in the preferences but can't seem to find any way to tell Acrobat what my email program is (Opera's mail client). Any idea?

               

              Another thing: to construct the PDF name for the current document, could you not simply say the following?

              myFilePath = String (myIndesignDoc.fullName).replace (/indd$/, "pdf");

               

              Thanks,

               

              Peter

              • 4. Re: How to communicate with Acrobat from InDesign
                [Jongware] Most Valuable Participant

                myFilePath = String (myIndesignDoc.fullName).replace (/indd$/, "pdf");

                 

                Kasyan is careful not to mess up a filename without its extension

                 

                Yours may be a bit better if you use this (untested!)

                 

                myFilePath = String (myIndesignDoc.fullName)+".indd";

                myFilePath = String (myIndesignDoc.fullName).replace (/\.indd(\.indd)?$/, "pdf"); (oops)

                myFilePath = myFilePath.replace (/\.indd(\.indd)?$/, "pdf");

                 

                to always make sure the original name ends with ".indd".

                • 5. Re: How to communicate with Acrobat from InDesign
                  Peter Kahrel Adobe Community Professional & MVP

                  > Kasyan is careful not to mess up a filename without its extension

                   

                  Have you ever seen an InDesign file without .indd extension?

                   

                  Peter

                  • 6. Re: How to communicate with Acrobat from InDesign
                    [Jongware] Most Valuable Participant

                    I trained my (primarily Mac!) co-workers not to. Usually by shouting until they promised never to do it again.

                     

                    I have seen lots of files without extensions -- all made on Mac's, of course, and predating OS X. It takes some binary-viewing and inspired guesswork to get hold of the original type.

                    • 7. Re: How to communicate with Acrobat from InDesign
                      Kasyan Servetsky Level 5

                      Peter,

                       

                      I use Microsoft Office Outlook 2007 — it works for me.

                      JavaScript for Acrobat API Reference says on page 130:

                      "Note: On Windows: The client machine must have its default mail program configured to be MAPI enabled to use this method".

                      I have vague idea about what that means, but may be it is your Opera's mail client that should be adjusted.

                       

                      My co-workers, sometimes, on rare occasions, contrive to make indd file names without extension, so I consider my approach to be more fool proved.

                       

                      Kasyan

                      • 8. Re: How to communicate with Acrobat from InDesign
                        Peter Kahrel Adobe Community Professional & MVP

                        Thanks, Kasyan. I'll give that a shot.

                         

                        If people save ID files without extension then your method is much better, naturally. Though how you can save an ID doc without extension (or an extension other than indd) isn't clear to me (not am I particularly interested). So they change the file's name after saving it?

                         

                        Peter

                        • 9. Re: How to communicate with Acrobat from InDesign
                          Steven.. Level 3

                          Is Opera Mail your Window Default Email client. If not goto Control Panel -> Internet Options -> Programs tab -> E-Mail on WinXP or something similar on Vista or Win7

                          • 10. Re: How to communicate with Acrobat from InDesign
                            Peter Kahrel Adobe Community Professional & MVP

                            Steven,

                             

                            Opera is the default email program. But anyhow, it's not terribly important.

                             

                            Thanks,

                             

                            Peter

                            • 11. Re: How to communicate with Acrobat from InDesign
                              Kasyan Servetsky Level 5

                              Peter,

                               

                              Your code is good, I like it because it's more concise— btw, I'm a fanatical adherent of the compact code. Working on Mac, I don't care much if a file  has an extension — it opens with or without it. But sometimes one of my scripts throws an error and it turns out that it's caused by missing extension. In the office, we all work on a network drive sitting in different rooms, so I have no idea how they do this: name or rename — I just take into account that the extension may be missing. But your one line code would work for me in 99,999999999999% of cases, so it's practically equivalent.

                               

                              Kasyan

                              • 12. Re: How to communicate with Acrobat from InDesign
                                Harbs. Level 6

                                On a Mac it's very, very easy to save without an extension. Just change this:

                                2010-03-15_0037.png

                                 

                                to this:

                                2010-03-15_0037_1.png

                                and Walla! you have a file that Windows will not have the slightest idea what to do with...

                                 

                                It's not good practice, but there's nothing at all to stop the un-educated from doing it!

                                 

                                Harbs

                                • 13. Re: How to communicate with Acrobat from InDesign
                                  Loic.Aigon Adobe Community Professional

                                  Hi all,

                                   

                                  First of all, thanks a lot Kasyan for your example.

                                  (Other people, don't worry I have already sent thanks to him in private a few weeks ago ;-) )

                                   

                                  So now I could take some time to handle it. But whatever I try, all my attempts are unsuccessful. Even the most simple function such as app.alert("foo") doesn't work. It's like Indesign didn't communicate at all with Acrobat.

                                   

                                  It's very annoying but it's doesn't matter so much. I was working on a script for which that ability would have a nice feature but that's ok. I am just upset to deal with things that work with some people but not the others :-(

                                   

                                  I am starting to remember why i carefully avoid scripting Acrobat

                                   

                                  To be constructive, I made my tests on a Windows XP, Acrobat 9 and CS4. In case these datas can be a clue.

                                   

                                  Loic

                                  • 14. Re: How to communicate with Acrobat from InDesign
                                    Kasyan Servetsky Level 5

                                    Did you try to run BridgeTalk.getSpecifier("acrobat"); in ESTK? What does it return?

                                    When you run BridgeTalk.getTargets(); is acrobat in the list?

                                    • 15. Re: How to communicate with Acrobat from InDesign
                                      Peter Kahrel Adobe Community Professional & MVP

                                      Hello Kasyan,

                                       

                                      >I'm a fanatical adherent of the compact code

                                       

                                      Good! I see your point about the possibility of extensionless file names (even if the chance is remote), but even then your code can be made more compact:

                                       

                                      myFilePath = String (myIndesignDoc.fullName)
                                      if (myFilePath.slice (-5) == ".indd")
                                          myFilePath = myFilePath.replace (/indd$/, "pdf");
                                      else
                                          myFilePath += ".pdf";

                                       

                                      Peter

                                      • 16. Re: How to communicate with Acrobat from InDesign
                                        Kasyan Servetsky Level 5

                                        Thank you, Peter.

                                        I'll certainly use your tip in my scripts.

                                         

                                        Kasyan

                                        • 17. Re: How to communicate with Acrobat from InDesign
                                          Laubender Adobe Community Professional & MVP

                                          Hello, Kasyan!
                                          When I run BridgeTalk.getTargets() in ESTK on my MacBook Pro OS X 10.5.8  I'm not getting "Acrobat". I get the following list:

                                           

                                          fireworks
                                          ame
                                          bridge
                                          devicecentral
                                          dreamweaver
                                          estoolkit
                                          exman
                                          flash
                                          illustrator
                                          indesign
                                          photoshop
                                          stockphotos

                                           

                                          You might wonder what applications like "ame" and "exman" might be: ame is Adobe Media Encoder, but I'm not sure about "exman".

                                          • 18. Re: How to communicate with Acrobat from InDesign
                                            Kasyan Servetsky Level 5

                                            ...but I'm not sure about "exman"

                                            My guess is that this is Extension Manager.

                                            ...on my MacBook Pro OS X 10.5.8  I'm not getting "Acrobat"...

                                            It's strange for me that this feature is supported on one platform and not on the other.

                                             

                                            Kasyan

                                            • 19. Re: How to communicate with Acrobat from InDesign
                                              Loic.Aigon Adobe Community Professional

                                              I have the same items on my mac, can 't test it on PC before monday.

                                              Thx for all.

                                              Loic

                                              • 20. Re: How to communicate with Acrobat from InDesign
                                                Loic.Aigon Adobe Community Professional

                                                Hi all,

                                                 

                                                Here is the result on a PC

                                                 

                                                CS3 :

                                                fireworks,acrobat,ame,bridge,contribute,devicecentral,dreamweaver,estoolkit,exman,flash,il lustrator,incopy,indesign,photoshop,stockphotos,switchboard

                                                 

                                                CS4:

                                                fireworks,acrobat,ame,bridge,contribute,devicecentral,dreamweaver,estoolkit,exman,flash,i llustrator,incopy,indesign,photoshop,stockphotos,switchboard

                                                 

                                                So acrobat is part of the list but I can't get it doing anything, argh.

                                                 

                                                Whatever, even if I get it running well on PC, the fact is not event working on mac broke the charm.

                                                 

                                                Thx again Kasyan.

                                                 

                                                Loic

                                                • 21. Re: How to communicate with Acrobat from InDesign
                                                  Muthuraj Durairaj Level 1

                                                  Thanks Kasyan! you have done a great help to me. I have tried your script and it works fine till generating pdf. My requirement is little different. I have a field called "Email" in pdf and a action to set for that button to attach with email.

                                                   

                                                   

                                                  #target indesign
                                                  var myIndesignDoc = app.activeDocument;
                                                  var myParentFolder = myIndesignDoc.fullName.parent;
                                                  var myBaseName = GetFileNameOnly(myIndesignDoc.name);
                                                  var myFilePath = myParentFolder.absoluteURI + "/" + myBaseName + ".pdf";
                                                  var myFile= new File(myFilePath); 
                                                  var mylayerText = myIndesignDoc.layers.item("Text")
                                                  var mylayerGraphics = myIndesignDoc.layers.item("Graphics")
                                                  var mylayerOnlinePdf = myIndesignDoc.layers.item("Online PDFs")
                                                  var mylayerTagline = myIndesignDoc.layers.item("Print tagline")
                                                  mylayerText.visible = true
                                                  mylayerGraphics.visible = true
                                                  mylayerOnlinePdf.visible = true
                                                  mylayerTagline.visible = false
                                                  var myPDFExportPreset = app.pdfExportPresets.item("EBLowRes");
                                                  app.activeDocument.exportFile(ExportFormat.pdfType, myFile, false, myPDFExportPreset);
                                                  //myIndesignDoc.exportFile( ExportFormat.pdfType, myFile, false, "[Smallest File Size]" );
                                                   
                                                  var myScript = AcrobatScript.toString() + '\r';
                                                  myScript += 'AcrobatScript(\"' + myFilePath + '\");'; 
                                                  var bt = new BridgeTalk;
                                                  bt.target = "acrobat-9.0";
                                                  bt.body = myScript;
                                                  bt.send();
                                                   
                                                  function AcrobatScript(myFilePath) {
                                                       var myAcrobatDoc = app.openDoc(myFilePath);
                                                   //app.execMenuItem("Email");
                                                    var f = myAcrobatDoc.getField("Email", "button");
                                                    f.setAction("MouseUp", "myAcrobatDoc.mailDoc(true);" );
                                                       //myAcrobatDoc.mailDoc({
                                                          //  bUI: false, // don't show dialog box
                                                           // cTo: "someone@somewhere.com", // e-mail address 
                                                            //cSubject: "This message was sent you by script", // subject line
                                                            //cMsg: "Here goes some message text."// message body
                                                       //});
                                                       myAcrobatDoc.closeDoc( false );
                                                  }
                                                   
                                                  function GetFileNameOnly(myFileName) {
                                                       var myString = "";
                                                       var myResult = myFileName.lastIndexOf(".");
                                                       if (myResult == -1) {
                                                            myString = myFileName;
                                                       }
                                                       else {
                                                            myString = myFileName.substr(0, myResult);
                                                       }
                                                       return myString;
                                                  }
                                                  


                                                  I tried this little modified code and it generates the pdf but does not set action for that particular button.

                                                   

                                                  The code I am using in Acrobat to set action is

                                                   

                                                  var f = this.getField("Mail", "button");
                                                  f.setAction("MouseUp", "this.mailDoc(true);" );
                                                  

                                                   

                                                  Rather than going to Acrobat and run this script manually is this possible to combine this action within Indesign script? 

                                                   

                                                  Please help me.

                                                   

                                                  Regards,

                                                  Muthuraj. D

                                                  • 22. Re: How to communicate with Acrobat from InDesign
                                                    Kasyan Servetsky Level 5

                                                    Rather than going to Acrobat and run this script manually is this possible to combine this action within Indesign script? 

                                                    if you're on Mac not , if on Windows -- most probably yes. Which version of InDesign do you use?

                                                     

                                                    Kasyan

                                                    • 23. Re: How to communicate with Acrobat from InDesign
                                                      Muthuraj Durairaj Level 1

                                                      Hi Kasyan, Thanks for your quick reply.

                                                       

                                                      I am using Windows, Indesign CS4 and Acrobat 9 Pro Extended. I hope I am lucky to get the solution

                                                      • 24. Re: How to communicate with Acrobat from InDesign
                                                        Kasyan Servetsky Level 5

                                                        Could you send me a sample InDesign document so I could test your script on it? My e-mail is askoldich [at] yahoo [dot] com.

                                                        I have CS3 installed on my Windows machine -- hope it would work the same way as on CS4.

                                                         

                                                        Kasyan

                                                        • 25. Re: How to communicate with Acrobat from InDesign
                                                          Muthuraj Durairaj Level 1

                                                          Hi Kasyan,

                                                           

                                                          I have sent a indesign file to your mail ID.

                                                          • 26. Re: How to communicate with Acrobat from InDesign
                                                            Kasyan Servetsky Level 5

                                                             

                                                             

                                                             

                                                            Muthuraj,

                                                             

                                                            You say that you run this script manually in Acrobat:

                                                            var f = this.getField("Mail", "button");
                                                            f.setAction("MouseUp", "this.mailDoc(true);" );

                                                             

                                                            But it gives me an error both in Acrobat 9 on Mac and 8 on PC:

                                                            TypeError: f has no properties
                                                            2:Console:Exec
                                                            Undefined

                                                             

                                                            I checked getField method in Acrobat reference:

                                                            getField  -- Maps a Field object in the PDF document to a JavaScript variable.

                                                            Beginning with Acrobat 6.0, this method can return the Field object of an individual widget. For more information, see Field object.

                                                             

                                                            Parameters -- cName -- The name of the field of interest.

                                                            Returns -- A Field object representing a form field in the PDF document.

                                                             

                                                            As far as I understand, there should be 1 parameter instead of 2.

                                                            I run your script from post #21 -- it exported a pdf-file. Does this file contains the field you want to add the action to? What is the name of this field: "Mail" or "button"?

                                                            I am not an expert in Acrobat -- never worked with forms, fields, etc. Could you describe me in short how to do what the script does manually in Acrobat?

                                                             

                                                            Kasyan

                                                            • 27. Re: How to communicate with Acrobat from InDesign
                                                              Muthuraj Durairaj Level 1

                                                              Hi Kasyan,

                                                               

                                                              Following are the stpes to be done manually in a pdf to set action to attach with email. To do this we dont need any prior named field to set action. We can create this link whereever we want in pdf.

                                                               

                                                              1. Open a pdf

                                                              2. Select the area with Link tool where you want to create link

                                                              3. In the Create Link popup window, select Custom Link and click Next

                                                              4. In Link Properties popup window go to the tab Actions. In that Select Action field, choose Execute a menu item and click Add. Select File > Attach to Email and click OK and OK to close the popup window.

                                                               

                                                              Now you can see that particular action has been set for that linked area.

                                                               

                                                               

                                                              To automate this action in pdf, we need a field already available in pdf as the email image placement is not constant. The position may vary. So, I thought of creating a button in Indesign so that it would get converted as a field in pdf. In Acrobat we can identify a field and set action using Javascript.

                                                               

                                                              In the Indesign file which I sent to you, you can see a button created with the name Email to generate a field called Email in pdf.

                                                               

                                                              The script which I sent to you is working fine at my system (Acrobat 9 and Windows XP)

                                                               

                                                              var f = this.getField("Mail", "button");
                                                              f.setAction("MouseUp", "this.mailDoc(true);" );

                                                               

                                                              and Mail is the name of the field and button is the type of the field here. And the indesign file has the Email button and it get converted to a field in pdf.

                                                               

                                                              Hope I am not confusing you much and I have answered your questions. Thanks for all your help on this.

                                                               

                                                              Muthuraj. D

                                                               

                                                              • 28. Re: How to communicate with Acrobat from InDesign
                                                                Muthuraj Durairaj Level 1

                                                                Kasyan,

                                                                 

                                                                Also, please try this code in Acrobat

                                                                 

                                                                var f = this.getField("Email", "button");
                                                                f.setAction("MouseUp", "this.mailDoc(true);" );

                                                                 

                                                                Since the indesign has the button name as Email the field in pdf also get named with Email. Please update Mail with Email in the code and try again. Sorry, I updated this info in the full set of code in indesign and gave you the old code

                                                                • 29. Re: How to communicate with Acrobat from InDesign
                                                                  Kasyan Servetsky Level 5

                                                                   

                                                                  Hi Muthuraj,

                                                                   

                                                                  Here is the working script:

                                                                   

                                                                  #target indesign
                                                                  var myIndesignDoc = app.activeDocument;
                                                                  var myParentFolder = myIndesignDoc.fullName.parent;
                                                                  var myBaseName = GetFileNameOnly(myIndesignDoc.name);
                                                                  var myFilePath = myParentFolder.absoluteURI + "/" + myBaseName + ".pdf";
                                                                  var myFile= new File(myFilePath); 
                                                                  var mylayerText = myIndesignDoc.layers.item("Text")
                                                                  var mylayerGraphics = myIndesignDoc.layers.item("Graphics")
                                                                  var mylayerOnlinePdf = myIndesignDoc.layers.item("Online PDFs")
                                                                  var mylayerTagline = myIndesignDoc.layers.item("Print tagline")
                                                                  mylayerText.visible = true
                                                                  mylayerGraphics.visible = true
                                                                  mylayerOnlinePdf.visible = true
                                                                  mylayerTagline.visible = false
                                                                  var myPDFExportPreset = app.pdfExportPresets.item("EBLowRes");
                                                                  app.activeDocument.exportFile(ExportFormat.pdfType, myFile, false, myPDFExportPreset);
                                                                   
                                                                  var myScript = AcrobatScript.toString() + '\r';
                                                                  myScript += 'AcrobatScript(\"' + myFilePath + '\");'; 
                                                                  var bt = new BridgeTalk;
                                                                  bt.target = "acrobat";
                                                                  bt.body = myScript;
                                                                  bt.send();
                                                                   
                                                                  function AcrobatScript(myFilePath) {
                                                                      var myAcrobatDoc = app.openDoc(myFilePath);
                                                                      var f = myAcrobatDoc.getField("Mail");
                                                                      f.setAction("MouseUp", "this.mailDoc(true);");
                                                                      myAcrobatDoc.saveAs(myFilePath);
                                                                      myAcrobatDoc.closeDoc(true);
                                                                  }
                                                                   
                                                                  function GetFileNameOnly(myFileName) {
                                                                       var myString = "";
                                                                       var myResult = myFileName.lastIndexOf(".");
                                                                       if (myResult == -1) {
                                                                            myString = myFileName;
                                                                       }
                                                                       else {
                                                                            myString = myFileName.substr(0, myResult);
                                                                       }
                                                                       return myString;
                                                                  }
                                                                  

                                                                   

                                                                   

                                                                  Your code didn't work because it had a couple of problems:

                                                                   

                                                                  #1

                                                                  var f =this.getField("Mail", "button");

                                                                  should be

                                                                  var f =myAcrobatDoc.getField("Mail");

                                                                  Since your code is inside the function, this keyword doesn't reference to the active document, probably it references to the object calling the function instead.

                                                                   

                                                                  Where did you see the 2nd parameter for getField method in the acrobat reference? I guess that acrobat just ignores it.

                                                                   

                                                                  #2

                                                                  myAcrobatDoc.closeDoc(false );

                                                                   

                                                                  False means that the user will be prompted to save the document if it has been modified.

                                                                  True means that the document will be closed silently without saving

                                                                   

                                                                  So we should save it to the same location and close it without prompt:

                                                                  myAcrobatDoc.saveAs(myFilePath);

                                                                  myAcrobatDoc.closeDoc(true);

                                                                   

                                                                  But Acrobat has a pitfall -- so called Save path, which means that you can't run the script if your document is in a system critical folder -- e.g. root, windows or system directory.

                                                                  For example, the script works if your file is here:

                                                                  C:\Test\EmailIcon.indd

                                                                  and doesn't works if it's here:

                                                                  C:\ EmailIcon.indd

                                                                   

                                                                  Regards,

                                                                  Kasyan

                                                                  • 30. Re: How to communicate with Acrobat from InDesign
                                                                    Muthuraj Durairaj Level 1

                                                                    Hi Kasyan,

                                                                     

                                                                    Thanks for all your support and explanatory answer.

                                                                     

                                                                    I tried the given code and it is working perfectly till creating a pdf and not doing it's part in Acrobat. It just generate a pdf. I think it is still not communicating with Acrobat. I can say this as we have included a code to close the document (myAcrobatDoc.closeDoc(true); ) after done everything, but it is not happening. Please help me Kasyan. It would be so great if you make this script work in Acrobat as well. Again, thanks a lot for your continueous support.

                                                                     

                                                                    Regards,

                                                                    Muthuraj. D

                                                                    • 31. Re: How to communicate with Acrobat from InDesign
                                                                      Kasyan Servetsky Level 5

                                                                       

                                                                      Hi Muthuraj,

                                                                       

                                                                      Believe it or not, but this script worked for me on InDesign CS3 + Acrobat 8.0

                                                                      According to Acrobat API reference (version 9.1), methods and their parameters used in the script haven't changed since version 8, so I think it should work for you too. However I can't check it since I don't have windows version of CS4 (PC computers available to me are too old). On Mac it doesn't work.

                                                                       

                                                                      Currently the script doesn't handle any errors that might occur in the acrobat part, so you should either test the script being sent from InDesign to Acrobat yourself, or add an error handler.

                                                                       

                                                                      I suggest you to do the following test:

                                                                      1) Add this line

                                                                      ...

                                                                      bt.body = myScript;

                                                                      $.writeln(myScript);

                                                                      bt.send();

                                                                      ...

                                                                      and run the script from ESTK

                                                                       

                                                                      2) Copy the script from ESTK console -- don’t include true (or false) at the end of the last line -- and paste it into Acrobat's console and run the script. See if any error occurs.

                                                                       

                                                                      Kasyan

                                                                      • 32. Re: How to communicate with Acrobat from InDesign
                                                                        Muthuraj Durairaj Level 1

                                                                        Hi Kasyan,

                                                                         

                                                                        Sorry, I was not well for a week and I could not access to the internet. I tried the following methods however it still not happening in Acrobat. It generates the pdf and stops.

                                                                         

                                                                        I tried running it in Acrobat console and it did not give any error.

                                                                         

                                                                        Please advise. Thanks.

                                                                        • 33. Re: How to communicate with Acrobat from InDesign
                                                                          Kasyan Servetsky Level 5

                                                                          Try to add error handler to the BridgeTalk message:

                                                                          bt.body = myScript;
                                                                          bt.onError = function(resObj)
                                                                          {
                                                                               alert(resObj.body);
                                                                               exit();
                                                                          }
                                                                          bt.send();
                                                                          

                                                                           

                                                                          Kasyan