automation - 如何通过 autohotkey 使用自动化 netbeans ide 格式化我的 java 代码?
问题描述
我想通过将密钥发送到隐藏的 NetBeans IDE 来格式化选定的 Java 代码。我编写了以下脚本
^+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
但是尝试使用 ControlSend 发送密钥时会弹出隐藏的 NetBeans,并且我无法使用 WinMinimize,"Netbeans" 最小化 Netbeans 窗口。我该如何解决这个问题?
解决方案
您不需要使用引号,您的代码将无法正常工作。如果你愿意,你不必使用逗号。
此代码工作正常:
WinMinimize Netbeans
; WinMinimize, Netbeans ; this will work too
使用逗号:
WinMinimize % "Netbeans"
但由于某些程序使用动态窗口名称,您最好按进程名称最小化程序:
WinMinimize, ahk_exe netbeans.exe
此外,您可以最小化活动窗口:
WinMinimize A
推荐阅读
- c++ - Qt + OpenGL : how to properly override QOpenGLWidget::resizeEvent?
- html - 如何在加载新页面之前添加微调器?
- react-native - Invariant Violation error when using Redux with react-native
- r - How can I inject symbols for autocompletion into R in a specific context?
- java - 更改矢量应用程序图标的背景颜色
- jquery - want to run jquery one time on multiple reload
- android - IsConnected 是否包含流量节省程序状态?
- mapbox - Mapbox GL JS:JSON点消失
- material-ui - 不确定为什么 MultiSelect 样式不符合预期 - Material UI
- bash - 将引号添加到 appveyor.yml 回显行