AutoHotKey

How do I automate a Java application with AutoHotkey?

孤者浪人 提交于 2019-11-27 19:26:15
问题 I use a Java application at work. I need to send clicks to buttons and fill in textboxes. I would like these actions to happen in the background. The ahk_class of the window is SunAwtFrame, and none of the controls are exposed to WindowSpy. I have used JavaFerret to determine that the first button I want to press has an AccessibleAction Version Information: Java virtual machine version: 1.7.0_25 Access Bridge Java class version: 1.7.0_25 Access Bridge Java DLL version: AccessBridge 2.0.2

Detect a double key press in AutoHotkey

风流意气都作罢 提交于 2019-11-27 15:36:50
问题 I'd like to trigger an event in AutoHotkey when the user double "presses" the esc key. But let the escape keystroke go through to the app in focus if it's not a double press (say within the space of a second). How would I go about doing this? I've come up with this so far, but I can't work out how to check for the second escape key press: ~Esc:: Input, TextEntry1, L1 T1 endKey=%ErrorLevel% if( endKey != "Timeout" ) { ; perform my double press operation WinMinimize, A } return 回答1: Found the

AutoHotKey key SEQUENCE, not just single-key hotkey

喜欢而已 提交于 2019-11-27 13:53:46
I'm not stupid... really. How do you map a key SEQUENCE (ie: Ctrl + Q , F ) in AutoHotKey. I've got Ctrl + Q down: ^q:: I've even got F : f:: The examples in the help files even show how to do two keystrokes in a row: Numpad0 & Numpad1:: But it just will not work with: ^q & f :: Or any of these either: LCtrl & q & f:: ^q & ^f:: ^q^f:: ^qf:: How do I accomplish a Key SEQUENCE triggering something, when one of those keys is the Ctrl key? I looked into using a HOTSTRING instead, but couldn't work out how to include the Ctrl character, in that context! Alright; The answer seems to be: ^q:: Input

How to add administrator privileges to AutoHotkey script?

限于喜欢 提交于 2019-11-27 06:21:10
问题 I compiled it to an executable, but to open it I have to right-click and press "Run as administrator". I want it to request admin privileges each time I run it, but how to do it? I can't do this: Because then it doesn't work when I copy it to a second computer. 回答1: Try adding this to the auto-execute section (top of the script): ; If the script is not elevated, relaunch as administrator and kill current instance: full_command_line := DllCall("GetCommandLine", "str") if not (A_IsAdmin or

How do I wait for Google Chrome to load a webpage before continuing in AutoHotkey?

折月煮酒 提交于 2019-11-27 06:02:23
问题 I am working on a AutoHotkey script that does a repetitive job in Google Chrome. Every time that I click a link from the script, I have to tell my script to sleep while the page loads. I am wondering if there is a way in AHK for me to tell the script to wait for the browser to finish to finish loading the page rather than sleeping for a set amount of time. Is this possible? 回答1: While Karthik's answer is better than a sleep command, and it can function fairly well for many sites, I found that

What happens 'behind' the windows lock screen?

≯℡__Kan透↙ 提交于 2019-11-27 02:41:02
问题 I have been working on windows automation and monitoring. What exactly happens when I lock the screen of a windows machine? I am working with Windows 7 at the moment, are there big differences to the behavior if I switch to Vista or the server versions? Is there still a desktop that can be accessed via api's? I know that i can still send key strokes and mouse clicks to specific windows (via ControlSend and ControlClick), but there seems to be no "desktop" itself. Could someone shed some light

AutoHotKey key SEQUENCE, not just single-key hotkey

落花浮王杯 提交于 2019-11-26 16:31:33
问题 I'm not stupid... really. How do you map a key SEQUENCE (ie: Ctrl + Q , F ) in AutoHotKey. I've got Ctrl + Q down: ^q:: I've even got F : f:: The examples in the help files even show how to do two keystrokes in a row: Numpad0 & Numpad1:: But it just will not work with: ^q & f :: Or any of these either: LCtrl & q & f:: ^q & ^f:: ^q^f:: ^qf:: How do I accomplish a Key SEQUENCE triggering something, when one of those keys is the Ctrl key? I looked into using a HOTSTRING instead, but couldn't

利用AutoHotkey实现Vim和Excel的数据传递

瘦欲@ 提交于 2019-11-26 11:07:11
应用场景是Excel某N列数据想用Vim处理后再复制回Excel。 Vim提供了ole接口供其他语言调用,详见:h ole.txt。 一、先说从Vim缓冲区内容转到Excel 用如下命令就能获取Vim当前缓冲区的内容(字符串格式),需要用iconv来转换编码供ahk使用。 oVim := ComObjActive("Vim.application") rs := oVim.eval('line("$")') ;行数 str := oVim.eval('iconv(join(getline(1,"$"),"\r\n"),"utf-8","cp936")') 对str的第一行内容用tab分割就知道有几列数据了(如果后面列数比第1行多就会报错了,可以多设置列数) loop parse, str, "`n", "`r" { cs := StrSplit(A_LoopField, A_Tab).length() break }   然后就可以用ComObjArray把字符串转成数组,再写入Excel的selection即可 arrA := ComObjArray(12, rs, cs) loop parse, str, "`n", "`r" { r := A_Index-1 for k, v in StrSplit(A_LoopField, A_Tab) arrA[r,k-1] := v

WEB前端开发新手入门:html语言学习的7个秘诀

笑着哭i 提交于 2019-11-25 20:55:52
WEB前端开发学习过程中,作为一个新手入门级别的菜鸟你,要如何的高效的学习呢? html语言学习的7个秘诀 也就是说如何学习HTML语言。 新手们有一个常见的错误就是犹豫于判断哪种编程语言是做好的、最该先学的。 我们有很多的选择,但你不能说那种语言“最好”。 我们应该理解:说到底,什么语言并不重要。 重要的是理解数据结构、控制逻辑和设计模式。 任何一种语言—甚至一种简单的脚本语言—都会具有所有编程语言都共有的各种特征,也就是说各种语言是贯通的。 我编程使用Pascal,汇编,和C语言,事实上我从来没有把它当成职业以求获得回报。 我一直在自学编程,工作上用不到它,我使用现有的知识,参考各种文档和书本,学习它们的用法。 因此,不要急于选择何种编程语言。 找出你想要开发的东西,使用一种能够完成这项任务的语言,这就可以了。 根据各种开发平台的不同,有很多不同的软件开发形式可供你选择:从网站应用到桌面软件到智能手机软件到命令行脚本工具。 我先假设你是一个悟性很强的读者,但对于新手,当我谈论程序代码时还是要按照入门级的水平。因为即使是你自己看一篇编程入门手册,如果发现都能理解时,心情自然会很高兴,这样利于你进一步学习。 桌面脚本 想要动手在Windows里或苹果系统里编程,最简单的方法是从一种脚本语言或宏语言开始,例如AutoHotkey(Windows) 或Automator(苹果系统)。