2020.1

Table Of Contents
Script Debugger
The Script Debugger allows you to test personalization scripts by setting breakpoints and
stepping through the scripts. (See also: "Testing scripts" on page387.)
There are two ways to start the Script Debugger:
l
Click the Debug Scripts button in the toolbar of the Scripts pane. The Script Debugger
will pause and accept input as soon as it processes the first script.
l
Right-click an enabled script in the Scripts panel and choose Debug from the contextual
menu. The Script Debugger will pause and accept input as soon as it processes the
selected script.
The Debugger simulates an output run with only the current record and appears as soon as the
merge engine processes the selected script, or the first script if no script was selected. You can
then add breakpoints and/or step through the code.
Meanwhile, the Workspace will display the partially merged document.
Scripts and call stack
The left side of the window displays all enabled scripts that apply to the current context, with the
call stack on top.
If the selector of a standard script or post pagination script has no matches in the current
resource (Master Page or section) the script will be skipped.
If an error is thrown, the rest of the current script is skipped and execution continues with the
next script.
In the call stack, frames are ordered from new to old, top to bottom. The current stack frame has
an arrow indicator. You will only see multiple stack frames if execution is suspended inside a
function.
You can click a frame to make it the current frame. The Variables panel always reflects the state
of the current frame. Note that this does not move the instruction pointer. The script remains
suspended at the most recent frame, even if that frame is not the current frame.
Source code
You can click any script at the left to view it in the source editor at the top right. An instruction
pointer in the left margin marks the current line.
The code is read-only, but clicking to the left of a line of code adds a breakpoint to it (except
Page 499