#Persistent

Keeps a script permanently running (that is, until the user closes it or ExitApp is encountered).

#Persistent

A script is persistent if any of the following conditions are true:

Use this directive to prevent the script from exiting after the auto-execute section (top part of the script) completes. This is useful in cases where a script contains timers and/or custom menu items but does not meet any of the other conditions listed above.

If this directive is added to an existing script, you might want to change some or all occurrences of Exit to be ExitApp. This is because Exit will not terminate a persistent script; it terminates only the current thread.

[v1.0.16+]: This directive also makes a script single-instance. To override this or change the way single-instance behaves, see #SingleInstance.

Like other directives, #Persistent cannot be executed conditionally.

#SingleInstance, SetTimer, Menu, Exit, ExitApp

Examples

Causes the script to run permanently; that is, it will not exit automatically if it could.

#Persistent