Persistent

最後のスレッドが完了したときにスクリプトが自動的に終了するのを防ぎ、アイドル状態で実行し続けることができるようにします。

Persistent Persist

パラメータ

Persist

型:論理値

省略されたときは、デフォルトで>Trueになります。

If true, the script will be kept running after all threads have exited, even if none of the other conditions for keeping the script running are met.

If false, the default behaviour is restored.

戻り値

型:整数(ブーリアン)

This function returns the previous setting; either 0 (false) or 1 (true).

備考

If Persistent is not used, the default setting is 0 (false).

スクリプトが永続的である場合、起動が完了し、他のすべてのスレッドが終了した後も実行され続けます。ホットキーへの反応、タイマーの実行、GUIの表示など、ユーザーがスクリプトを実行し続けたいと思う一般的なケースのほとんどで、スクリプトは自動的に永続化されるため、通常この関数を呼び出す必要はありません。

この機能が必要となるケース(実行中のスレッドやホットキー、タイマーなどがないときに実行し続けることを意図している場合)には、以下のようなものがあります:

既存のスクリプトにこの機能を追加する場合、Exitの一部または全部をExitAppに変更する必要がある場合があります。これは、Exitが永続的なスクリプトを終了させず、現在のスレッドのみを終了させるからです。

Exit, ExitApp

スクリプトが自動的に終了しないようにします。

; This script will not exit automatically, even though it has nothing to do.
; However, you can use its tray icon to open the script in an editor, or to
; launch Window Spy or the Help file.
Persistent