AutoHotKey

Autohotkey How to hold a mouse button while a key is pressed?

泪湿孤枕 提交于 2019-12-04 05:31:49
In short: How do I write an autohotkey script so that when I press, say, F1, it presses the mouse button down and only lets it go after I let go of the key? I did some research on both autohotkey forums (which redirect here for asking questions) and read through the documentation, but I'm no programer and have a difficult time grasping loops. I tried doing while or if(getkeystate("F1") loops but I kept getting it wrong until finally I've ended up with this script, which almost works. F2::Click down right F2 Up::Click up right F1::Click down F1 Up::Click up When I say almost, I mean it doesn't

Hotkey to restart autohotkey script?

隐身守侯 提交于 2019-12-04 04:48:46
Say I have an autohotkey script C:\path\to\my\script running. Is there a way to define a hotkey that re-starts it? Robert Ilbrink In order to prevent duplicate instances, I normally do not re-launch a script but use the build-in function Reload . I launch this with Ctrl + Win + Alt + R and use Ctrl + Win + Alt + E to edit the main AHK script. ^#!r::Reload Actually, my script looks like this: ^#!r:: Send, ^s ; To save a changed script Sleep, 300 ; give it time to save the script Reload Return ^!#e::Edit As a matter of fact, all the way at the top of my script I have this to give me a visual and

Autohotkey: Send 5 digit hex unicode chars

北慕城南 提交于 2019-12-04 03:58:56
问题 I have been trying to find a way to remap my keyboard and send 5-digit hex unicode chars, the method described here: ahk Send only supports 4-digit hex codes {U+nnnn}, I know that in the past, autohotkey didnt support unicode natively so it was needed some functions in order to do that, maybe thats the solution for me. Example: #If GetKeyState("CapsLock","T") +u::Send {U+1D4B0} The results from that is 풰 instead of 𝒰, and the code for 풰 is {U+D4B0}, meaning AHK is reading only the last 4

How to concatenate a number and a string in auto hotkey

戏子无情 提交于 2019-12-04 02:13:06
I have the following auto hotkey script: A:= 5 B := "7" C := A.B MsgBox %C% The third line does not work. I'm expecting output of "57" I have tried the following: C := %A%.%B% C := (A).(B) C := (A.B) C := (%A%.%B%) C := (%A%).(%B%) None of which work Can anyone tell me how to do it? I'm using version 1.1.09.04 Just updated to latest version 1.1.14.01 and its still the same You have distinguish between expressions ( := ) and "normal" value assigments ( = ). Your goal can be met with several approaches, as shown in the following examples: a := 5 b := 7 x := 6789 ; String concatenation str1 = %a%

Global variable does not have global scope

£可爱£侵袭症+ 提交于 2019-12-04 00:19:12
supposedlyGlobalVariable := "blah" ARoutine() { localVariable := "asdf" MsgBox, The global variable value is %supposedlyGlobalVariable%. The local variable value is %localVariable%. } ^!X:: ;This assigns the hotkey CTRL + ALT + X to run the routine ARoutine() return Run the code and the result is: "The global variable value is . The local variable value is asdf." The documentation states: Variable scope and declarations: With the exception of local variables in functions, all variables are global; that is, their contents may be read or altered by any part of the script. Why does my global

Ahk: run a python script with args

核能气质少年 提交于 2019-12-03 21:38:44
I have seen this thread (and many others) but I am still not able to retrieve the args in python. 1) With this... Run Cmd \k "Python C:\my.py %myvar%" ... a Cmd is open but nothing happens : my.py isn't started. 2) With this... Run C:\my1.py %myvar% ... the python script is run but when I retrieve the args with sys.argv , I only get the path of the script not myvar . Len(sys.arg) return 1 so myvar isn't passed down to python. This thread solved it. commands= (join& python "C:\my.py" "%myvar%"`n ) Run, cmd /c %commands% return It's also possible to use Run, cmd /k %commands% or Run,%comspec% /k

Hotkey for next song in Spotify

自作多情 提交于 2019-12-03 18:32:37
问题 After March 2015 upgrade of Spotify the below hotkey no longer works to get next song in Spotify: ; Spotify next track <^>!p:: DetectHiddenWindows, On ControlSend, ahk_parent, ^{Right}, ahk_class SpotifyMainWindow DetectHiddenWindows, Off Return The SpotifyMainWindow" appears to be the same when checking with spy, and Ctrl-Right also still works for next song in Spotify, but the hotkey don't. How to make a hotkey for next song in the upgraded Spotify? 回答1: I managed to make it work using

Right Click on Tray Icon in Windows 10 with AutoHotKey

馋奶兔 提交于 2019-12-03 15:49:01
In Windows 7, I had an AutoHotKey script that would automatically Right-Click on a tray icon. #Include %A_Scriptdir%\TrayIcon.ahk TrayIcon_Button("CCC.exe", "R") Which used the TrayIcon.ahk library from FanaticGuru's post . This worked just fine on Windows 7, but no longer works on Windows 10. Is there a way to right click on a TrayIcon in an AutoHotKey script on Windows 10? Here is the TrayIcon_Button function from the library. I refrained from posting the entire library since it is fairly long. ; ------------------------------------------------------------------------------------------------

AutoHotkey:Windows 下好用自动化工具

本秂侑毒 提交于 2019-12-03 14:13:13
   AutoHotkey 是一个自由、开源的宏生成器和自动化软件工具,它让用户能够自动执行重复性任务。 官方    AHK    DOC 相关站点    AHKNET    AHKSTUDIO ( download )    老外作品 TODO AltRun —— 原来是 delphi 的,很久没更新了,WIN7 下报错。希望能用 ahk 或者 perl/python 重写。 VirtuaWin 桌面信息 任务栏 窗口切换 Tips 中文UTF-8 FileEncoding UTF-8-RAW sub2 语法高亮 学习文档chm(中文API没有找到) AHK脚本管理器 Basic GUI creator ——maestrith Script Writer ——maestrith 一些学习资源 AutoHotkey 学习指南 ——善用佳软 AutoHotkey 0级入门教程:让重复工作一键完成 ——善用佳软 AHK 快餐店系列 AHK 快餐店[1] 之 让桌面图标都见鬼去吧 AHK 快餐店[2] 之 字符串也玩变形金刚 AHK 快餐店[3] 之 挖地三尺,文件夹想进就进 AHK 快餐店[4] 之 泡面专用计时器 AHK 快餐店[5] 之 打字太慢?试试屏幕键盘 AHK 快餐店[6] 之 颜色神偷 AHK 快餐店[7] 之 拒绝机械的重复操作 AHK 快餐店[8] 之 读者互动[1]

Dynamically Create AutoHotkey Hotkey to Function/Subroutine

时光怂恿深爱的人放手 提交于 2019-12-03 13:13:32
问题 The AutoHotkey command Hotkey allows for the creation of dynamic hotkeys at runtime, but its syntax and documentation seems to limit it to built-in or existing labels/subroutines, which makes it much less useful: Hotkey, KeyName [, Label, Options] Is there a way to get it to work like regular, hard-coded hotkeys? For example: #z::MsgBox foobar ; Typical, hard-coded hotkey pops up a message-box Hotkey, z, MsgBox foobar ; Nope; complains about missing label “MsgBox foobar” It looks like it