Copy link to clipboard
Copied
Hello!
I'm working on a form script that (unfortunately) relies a little on a try-catch statement.
The problem is that if the user sets their Acrobat to trace or break on exceptions, the Debug Console pops up every time there's an error (despite it being caught by the catch statement), disrupting the script.
I could try to teach the users to make sure they set the debugger to ignore errors before running this script, but the chances they'll actually do that are essentially nil.
So the question: Is there a way (at least temporarily, for the duration of the execution of the script) to set the debugger to ignore caught errors? Are Acrobat's Javascript preferences scriptable?
Or is there some other way around this issue?
Thanks!
Ariel
Copy link to clipboard
Copied
Not possible.
Copy link to clipboard
Copied
Not possible.
Copy link to clipboard
Copied
> Are Acrobat's Javascript preferences scriptable?
Some preferences are, but not anything related to JS itself, of course. That would be a huge security risk.
Copy link to clipboard
Copied
Hmm, if it's not possible, I'm wondering what the best way to handle this situation is.
In this case, I'm trying to apply a font to a field, but I can't be sure which of several options the user has installed.
I'm going through a list of possibilities, applying each with myField.textFont wrapped in a try-catch. If applying the font throws an error, I try the next.
Is there a better way of knowing whether a particular font is available for a user without relying on try-catch like this?
Copy link to clipboard
Copied
That's the only way I'm aware of.
Copy link to clipboard
Copied
Thanks, One feels Adobe could up their game a little when it comes to Acrobat scripting...
Is the debugger set to "ignore" by default? Most users probably haven't changed the default setting, so i suppose if it's ignore by default I can presume that the issue won't be too common?
Copy link to clipboard
Copied
I agree there are many areas where the scripting model can be improved...
I don't have an answer as to whether the debugger is disabled by default, but I think it is.
But you can make the Console (and Debugger) window appear via your code:
console.show();

