Force the AHK Script to Run as Administrator
Add this snippet to the very top of your .ahk script. It forces the script to self-elevate so it has the security clearance to see IntelliJ:
SetTitleMatchMode, 2
if not A_IsAdmin
{
Run *RunAs "%A_ScriptFullPath%"
ExitApp
}
; ... Your existing code ...
SmartAlert(Title, Message) {
global SmartAlertResult := 0
; --- THE UNIVERSAL TARGET FIX ---
CurrentIntelliJ := WinExist("IntelliJ IDEA ahk_exe idea64.exe")
if (CurrentIntelliJ) {
; Script execution logic goes here...
}
}
Top comments (0)
Subscribe
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Top comments (0)