image

Errors

image

AppleScript generates two kinds of error — compile errors and runtime errors. Script Debugger displays full information about where the error occurred and what went wrong.

If your script catches (handles) a runtime error with a try block, the error does not percolate up to AppleScript and it is not reported back to Script Debugger. In effect, there is no error.

In debug mode, however, you can break on an error even if it is caught.

Error Dialog

Error information is displayed in a dialog. The structure of the dialog reflects the structure of the error message received from AppleScript.

image

An error message received from AppleScript can contain up to six parts, corresponding to the five parameters of the AppleScript error command plus there an Application parameter supplied by AppleScript itself. These are displayed in the dialog as follows:

message string
Shown as text the top of the dialog.
number
Shown at the lower left of the dialog.
partial result
Shown as the Partial Result pane.
from
Shown as the Offending Object pane.
to
Shown as the Expected Type pane.
[application]
Shown as the Application pane.

The panes of the error dialog are explorers. If the value displayed in a pane is an object reference, Best view is an outliner, and individual lines can be double-clicked to create a separate explorer window.

To show the error message dialog again after dismissing it:

Error Location

After an error dialog is dismissed, the script is marked in three ways:

For information about a special kind of error situation where a file or transaction is left open, read on.

Further Details:
  Leaks


image
Variables Event Log
image