Hi all,
I'm coming into a weird scenario using AHK 1.1.33.10. What is expected to happen is when I "Run As Administrator" the attached text.ahk script it runs one instance of the script.
What happens instead is it somehow runs two instances simultaneously. I'm not accidentally clicking it open twice. Please see following youtube video:
https://www.youtube.com/watch?v=Hn5Eizh6byk
Got any idea on wth is going on here?
Potential bug AHK 1.1.33.10 script runs twice despite only being initiated once
Potential bug AHK 1.1.33.10 script runs twice despite only being initiated once
- Attachments
-
- test.ahk
- ahk script
- (2.73 KiB) Downloaded 24 times
Re: Potential bug AHK 1.1.33.10 script runs twice despite only being initiated once
This is a test script that runs as admin.
If it works, expand it iteratively, testing carefully along the way.
Line 30 in your script will yield unexpected results. To prove it, you can run the following demo.
Read about #If in the documentation.
Code: Select all
If !A_IsAdmin && !RegExMatch(DllCall("GetCommandLine", "str"), " /restart(?!\S)") {
Try Run *RunAs "%A_AhkPath%" /restart "%A_ScriptFullPath%"
ExitApp
} Else CoordMode, Mouse
#IfWinActive ahk_exe test.exe
F3::Send x
#IfWinActive ahk_exe test2.exe
F3::Send y
#IfWinActive
Line 30 in your script will yield unexpected results. To prove it, you can run the following demo.
Code: Select all
If GetKeyState("LAlt", "P")
F2::Send z
Re: Potential bug AHK 1.1.33.10 script runs twice despite only being initiated once
mikeyww, thanks for the quick response and suggestions! I'll tweak around with it and report back if it doesn't work out. Thanks!
Who is online
Users browsing this forum: Bing [Bot], peter_ahk and 123 guests