On Error Tab


Most macro command windows have a corresponding On Error tab for error handling during playback of the macro. For example if a specific condition isn't met during macro playback, such as a file or a window could not be found, the On Error tab can instruct the macro to stop, ignore the error and proceed, prompt for a course of action, or handle the error.



Script Editor > Open Any Macro Command Window > On Error Tab



In the example above the Window Activate command has four possible types of errors that may occur during macro playback. Each command lists a different set of errors that are pertinent to that specific macro command. In most cases it is appropriate to just leave the default action for each of the errors. But there may be cases for debugging or other situations where one of the other actions is more appropriate. A description of the actions is listed below.



Halt Macro

Halt Macro stops the macro if the error occurs during playback. This is the default error action and the one most commonly required.



Ignore Error

Ignoring the error instructs the macro to continue even though the error has occurred.



Prompt for Action

If an error occurs, a message similar to the one below appears on the screen prompting the user to decide how to proceed with the macro. Choose to stop the macro, ignore the error and continue or handle the error if additional error handling code is in the macro script.





Handle the Error

Use this option if subsequent error handling commands are included in the script, such as the On Error command. These subsequent error commands handle the error during macro playback.