1.4

l
The warning icon (!) appears, for example, when a script refers to an unknown field in
the record set, or when ; is missing after a statement.
l
The error icon (x) displays when the script results in an error, for example, when it uses
an undeclared variable.
In addition to the icons and messages in the Scripts pane, there is another way to see if your
scripts function as expected before generating output:
l
On the Context menu, click Preflight.
Preflight executes the template without actually producing output and it displays any issues
once it’s done.
It will tell, for example, which selectors were not encountered in the template.
Test for speed issues
To measure the time that the execution of scripts will take:
l
On the Context menu, click Profile scripts.
Profiling means running the scripts in the template, to see how fast scripts in the Scripts pane
execute. It helps greatly in troubleshooting performance issues caused by scripts.
After running the Script Profiler you can see in which sections the script has run:
l
Hover the mouse over a value in the column Count to see the number of times that the
script has run, per section.
You can also see the breakdown of the execution time across different execution stages:
l
Hover the mouse over a value in the column Elapsed to see the time elapsed (in
milliseconds) since the start of the session. In the Scripts Profiler, the scripts are by
default sorted based on the values in the Elapsed column, from high to low.
l
Hover the mouse over a value the column Delta to see the difference between the time
elapsed (in milliseconds) in the previous session and in the current session.
The script execution stages are:
Query: the time it takes to find the selector in the template.
Page 384