DEV Community

Query Filter
Query Filter

Posted on

docker-152

  1. 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...
    }
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)