1 Reply Latest reply on Sep 30, 2011 7:07 AM by try67

    this.extractPages is not a function


      I am new to scripting in Acrobat, and I am trying to make a folder-level script to allow for the duplication of pages, among other things.


      At this point, I have code that works for copying a page when the function is called, but the bizzare thing that keeps throwing errors is that when I nest that function in another, then the this.extractPages function apparently no longer exists.


      Here's the relevant code:


      function copyPage(page)




                var sourcePath = this.path;

                var tempPath = app.getPath("user","temp") + "temp.pdf";



                  nStart: page,

                  nEnd: page,

                  cPath: tempPath






                           nPage: page,

                           cPath: tempPath










      function copyPrompt()


                var dialogTitle = "Page to Copy";

                var defaultAnswer = this.pageNum;

                var nPage = app.response("Which page would you like to copy?", dialogTitle, defaultAnswer + 1) - 1;




      When I call copyPage(this.pageNum), it works properly, but when I call copyPrompt(), it fails when it calls the copyPage(nPage step). Then, I get the "this.extractPages is not a function" error.