Problem:
The function in OnClipboardChange gets executed twice when taking screenshot with ShareX
(Though, this may not be a bug of AHK, but a bug of ShareX?)
Procedure:
1. execute the following script
2. take a screenshot with ShareX
3. the function AA() will execute twice instead of once
Note:
- In step 2, If you copy a text instead, it works fine.
- In step 2, If you use printscreen instead, it works fine.
- If you test the script with MsgBox, aa , you won't have that bug.
- No issue in other softwares
Code: Select all
#NoEnv
#SingleInstance Force
#Persistent
OnClipboardChange("AA", 1)
AA() {
SendInput, aa
; If you test with [c] MsgBox, aa [/c], you won't have that bug
}
---- C:\Users\XXX\Desktop\AHK scripts\Test\Test.ahk
005: OnClipboardChange("AA", 1)
007: {
011: Exit (6.02)
008: SendInput,aa
010: } (0.01)
008: SendInput,aa
010: } (1.06)
Press [F5] to refresh.