Stefan Cameron on Forms
Building intelligent forms using Adobe LiveCycle Designer

'Debugging' Category Archive

Debugging Scripts

Here’s a simple tip that could make a huge difference in your ability to debug your scripts in Designer:

If you use the JavaScript language for a script, you can use the following function to output information to the JavaScript Console available in Acrobat Standard/Pro:

console.println("string");

When you preview your form in Designer or open it in Acrobat, you can use the “Ctrl + J” keyboard shortcut to display the JavaScript Console. Note that this feature is not available in Reader.

Anyone who has attempted to debug their script(s) in Acrobat knows that it’s a painful thing to do. Unfortunately, many only know about

app.alert("string");

or

xfa.host.messageBox("string");

which gets the job done but not without some headaches and, in certain cases, RSI in your index finger clicking through all those message boxes! The other problem is that showing a message box can cause differences in the form’s behaviour, especially if you’re trying to debug a script which is setting focus to an object on your form.

By using console.println, you can output text to the JavaScript Console so that you don’t change the behaviour of your scripts.

The ability to debug scripts is something we know needs serious attention in Designer and trust me, we’ve talked about it and we have plans to address these issues but I can’t speak about anything definite at this time.

Updated: August 5, 2008


Posted by Stefan Cameron on May 5th, 2006
Filed under Debugging,Scripting