DEV Community

Query Filter
Query Filter

Posted on

intel2

; --- INITIALIZATION ---
#NoEnv
SetTitleMatchMode, 2
CoordMode, ToolTip, Window
CoordMode, Mouse, Window
CoordMode, Pixel, Window

; --- THE TELEPORTATION HEADER ---
TargetWindow := "ahk_exe idea64.exe"

IfWinExist, %TargetWindow%
{
    ; 1. Grab the Unique ID (Handle) of IntelliJ
    WinGet, intellij_hwnd, ID, %TargetWindow%

    ; 2. Teleport to the IntelliJ Terminal
    WinActivate, ahk_id %intellij_hwnd%
    WinWaitActive, ahk_id %intellij_hwnd%
    Sleep, 150 ; Important: Give Java/IntelliJ time to redraw

    ; 3. Create the Red Dot Visual Ping
    WinGetPos, , , w, h, ahk_id %intellij_hwnd% ; Get window size
    CenterX := w / 2
    CenterY := h / 2

    ; Create a small 20x20 red circle window
    Gui, RedDot: +AlwaysOnTop -Caption +ToolWindow +LastFound
    Gui, RedDot: Color, Red
    ; Make it a circle using WinSet (optional but looks cool)
    WinSet, Region, 0-0 20-20 R20-20 

    ; Show the dot exactly in the center of the IntelliJ window
    ; We offset by 10 to center the 20px dot
    Gui, RedDot: Show, % "x" (CenterX - 10) " y" (CenterY - 10) " w20 h20 NoActivate"

    ; 4. Show the Big ToolTip
    ToolTip, `n`t TARGET ACQUIRED: INTELLIJ `n`t, CenterX, CenterY - 60

    ; 5. Stay for a moment then clean up
    Sleep, 1000
    Gui, RedDot: Destroy
    ToolTip
}
else
{
    MsgBox, 16, Error, IntelliJ process (idea64.exe) not found.
    ExitApp
}

; --- YOUR AUTOMATION STARTS HERE ---
; Send, ^s
Enter fullscreen mode Exit fullscreen mode

Top comments (0)