2 Replies Latest reply on Aug 17, 2010 6:03 PM by Bedgardauph

    CS4: Export as PDF isn't working when script is called by Bridge




      A strange (because it worked OK in the past) and frustrating problem:


      I have an InDesign script (VBScript) which does some processing then exports to PDF. When I click this script in the InDesign script panel it runs and produces good results.


      However, it's part of an automation system and won't be clicked from within InDesign. Instead, BridgeTalk is being used to send a small JavaScript to InDesign which in turn uses doScript to call the VBScript.


      When called from Bridge, InDesign hangs on this line:


                doc.Export idExportFormat.idPDFType, pdfPathName, False


      I cannot fathom why it does not hang on that line when I run the script from within InDesign, yet hangs when called from Bridge. ???


      The BridgeTalk code which sends a message to InDesign is this (I've removed the result and error call backs for brevity's sake):


        scpt = new File("/Program Files (x86)/Adobe/Adobe InDesign CS4/Scripts/Scripts Panel/do_osfactsheets.jsx");
        var btMessage = new BridgeTalk;
        btMessage.target ="indesign";
        scptfile = scpt.open("r");
        if (scptfile != true) {
         Window.alert("Can't open the initial script file.")
         return; }
        scptcontents = scpt.read();
        btMessage.body = scptcontents;

      The code in "do_osfactsheets.jsx" :


        file = new File('/Program Files (x86)/Adobe/Adobe InDesign CS4/Scripts/Scripts Panel/osfactsheets.vbs');
        app.doScript(sfile, ScriptLanguage.visualBasic);



      "osfactsheets.vbs" is the script which contains the pdf export which hangs when called through these messages. Again, it doesn't hang when run from within InDesign.


      Any comments and help would be greatly appreciated.



      PS. These are running in a Windows 7 virtual machine.