Registers a function to be called automatically whenever the clipboard's content changes.

OnClipboardChange Callback , AddRemove




The function to call.

The callback accepts one parameter and can be defined as follows:

MyCallback(DataType) { ...

Although the name you give the parameter does not matter, it is assigned one of the following numbers:

You can omit the callback's parameter if the corresponding information is not needed, but in this case an asterisk must be specified, e.g. MyCallback(*).

If this is the last or only callback, the return value is ignored. Otherwise, it can return a non-zero integer to prevent subsequent callbacks from being called.



省略されたときは、初期値は 1 です。それ以外の場合は、次のいずれかの番号を指定してください:


If the clipboard changes while a callback is already running, that notification event is lost. これが好ましくない場合は、Criticalを使用します。ただし、この場合、OnClipboardChangeスレッドの実行中に発生する他のスレッド(ホットキーの押下など)もバッファリング/ディファーされます。

If the script itself changes the clipboard, the callbacks are typically not executed immediately; that is, statements immediately below the statement that changed the clipboard are likely to execute beforehand. To force the callbacks to execute immediately, use a short delay such as Sleep 20 after changing the clipboard.



OnClipboardChange ClipChanged

ClipChanged(DataType) {
    ToolTip "Clipboard data type: " DataType
    Sleep 1000
    ToolTip  ; チップを切る。