Skip navigation
Currently Being Moderated

What is normal debugging cycle for addmenuitem?

Apr 18, 2012 7:37 PM

Tags: #javascript #debugging

Hello:

 

I'm debugging some code attached to menu items.  Is there a way to re-run modified *.js code without having to exit/reload Acrobat for each test iteration?

 

It's my understanding that the only way to load scripts into Acrobat is when it loads the scripts from the default location

 

C:\Program Files\Adobe\Acrobat 9.0\Acrobat\Javascripts

 

As a result, each change I make to the addmenuitem exec code requires that I unload Acrobat and reload it to get it to pick up the modified code. 

 

Is there another way to speed up this debugging cycle?

 

Thank you in advance.

 

-- Roy Zider

 
Replies
  • Currently Being Moderated
    Apr 18, 2012 8:58 PM   in reply to FUBARinSFO

    What I do when I am working on an Acrobat script that I am going to attach to a menu item is run the body of the script (without the part that attaches it to a menu item or a button) in Acrobat's debugger. Just go into acrobat and hit apple + J on a Mac (and probably something similar on a PC) and copy and paste your script into the main area of the debugger, select the whole script and hit the enter key (the one by the num pad not the regular enter key) and your script will run, if you get any errors they will be output below your code in the same window. Also if you want to log some part of your scrpt you can use "console.println(<<your stuff>>);

     

    HTH

    Leo

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 18, 2012 11:08 PM   in reply to Lev Ger

    I do that as well. The problem with that is that the console has a higher trust-level than a document-level script, so you get some things running in the console, but then have to mess around with creating trusted functions so they would work in your final script.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points