DEV Community

Query Filter
Query Filter

Posted on

intel4

; ==============================================================================
; STEP 1: INITIALIZATION (Standard User Mode)
; ==============================================================================
#NoEnv
#SingleInstance Force
SetTitleMatchMode, 2

; Set coordinate modes to "Window" 
CoordMode, ToolTip, Window
CoordMode, Mouse, Window
CoordMode, Gui, Window

; ==============================================================================
; STEP 2: THE TELEPORTATION HEADER
; ==============================================================================
; Try both common IntelliJ process names just in case
TargetProcess := "ahk_exe idea64.exe"
if !WinExist(TargetProcess)
    TargetProcess := "ahk_exe idea.exe"

IfWinExist, %TargetProcess%
{
    WinGet, intellij_id, ID, %TargetProcess%

    ; Jump to the IntelliJ Terminal/Desktop
    WinActivate, ahk_id %intellij_id%
    WinWaitActive, ahk_id %intellij_id%, , 3

    Sleep, 300 ; Extra buffer since we don't have Admin "priority"

    ; ==========================================================================
    ; STEP 3: VISUAL CONFIRMATION (Standard GUI)
    ; ==========================================================================
    WinGetPos, , , w, h, ahk_id %intellij_id%
    CenterX := w / 2
    CenterY := h / 2

    ; Simple Red Square (Circle region sometimes requires higher permissions)
    Gui, RedDot: +AlwaysOnTop -Caption +ToolWindow +LastFound
    Gui, RedDot: Color, Red

    ; Show Dot and ToolTip
    Gui, RedDot: Show, % "x" (CenterX - 10) " y" (CenterY - 10) " w20 h20 NoActivate"
    ToolTip, `n`t TARGET ACQUIRED: INTELLIJ `n`t, %CenterX%, % (CenterY - 80)

    Sleep, 1200
    Gui, RedDot: Destroy
    ToolTip

    ; ==========================================================================
    ; STEP 4: PREPARE DIALOGS
    ; ==========================================================================
    Gui, +OwnDialogs 
}
else
{
    MsgBox, 16, Startup Error, Could not find IntelliJ (idea64.exe or idea.exe).`nEnsure IntelliJ is open before running.
    ExitApp
}

; ==============================================================================
; YOUR CODE STARTS HERE
; ==============================================================================
MsgBox, 64, Success, Script is now active in IntelliJ!
Enter fullscreen mode Exit fullscreen mode

Top comments (0)