Reputation: 2913
I want to format selected java code with sending keys to hidden NetBeans IDE.I wrote following script
^+b::
sleep 30
Send ^c
sleep 30
run,C:\Program Files\NetBeans 8.2\bin\netbeans64.exe "C:\sample.java",Hide
sleep 1500
ControlSend,,{^v}, "Netbeans"
sleep 50
ControlSend,,{!+f}, "Netbeans"
sleep 50
ControlSend,,{^a}, "Netbeans"
sleep 50
ControlSend,,{^c}, "Netbeans"
sleep 50
WinMinimize,"Netbeans"
sleep 100
Send, ^v
return
But hidden NetBeans pops up when trying to send keys with ControlSend and I can't minimize Netbeans window with WinMinimize,"Netbeans".How can I fix this issues?
Upvotes: 1
Views: 132
Reputation: 326
You don’t need to use quotes, your code won’t be working. And if you want, you don’t have to use commas.
This code works fine:
WinMinimize Netbeans
; WinMinimize, Netbeans ; this will work too
Using with commas:
WinMinimize % "Netbeans"
But since some programs use dynamic window name, you’d better minimize programs by their process name:
WinMinimize, ahk_exe netbeans.exe
Also, you can just minimize the active window:
WinMinimize A
More: https://autohotkey.com/docs/misc/WinTitle.htm
Upvotes: 2
Reputation: 392
I don't use NetBeans so I can't experiment, but:
ControlSend
does seem to detect it correctly. However, I'd still make sure.PostMessage, 0x112, 0xF020,,, WinTitle, WinText ; 0x112 = WM_SYSCOMMAND, 0xF020 = SC_MINIMIZE
WinMinimize
, but WinHide
.Upvotes: 1