3 Replies Latest reply on Oct 18, 2010 8:53 AM by try67

    How to search "ActiveDocs" in folder-level script

    res_ipsa

      I am trying to perform a search in an Acrobat folder-level javascript like this:

       

           function timerCallback() {

                app.beginPriv();

                search.query(searchText, "ActiveDoc");

                app.endPriv();

           }

       

           app.beginPriv();

           app.openDoc(path_to_my_doc);

           app.endPriv();

           app.setTimeOut("timerCallback()", 5000);

       

      I use the setTimeOut function to make sure that the document has had enough time to open before I start the search.  The problem is that I get this error:

                GeneralError: Operation failed.

                Search.query:24:Folder-level:App:SearchScript.js

                No active document

       

      It seems like I can't "see" active documents from a folder-level script.  Is there any way around this?

       

      Thanks