我有以下自动热键脚本:
A:= 5
B := "7"
C := A.B
MsgBox %C%
Run Code Online (Sandbox Code Playgroud)
第三行不起作用.
我期待输出"57"
我尝试过以下方法:
C := %A%.%B%
C := (A).(B)
C := (A.B)
C := (%A%.%B%)
C := (%A%).(%B%)
Run Code Online (Sandbox Code Playgroud)
这些都不起作用
谁能告诉我怎么做?
我使用的是1.1.09.04版
刚刚更新到最新版本1.1.14.01,它仍然是相同的
我使用Autohotkey将alt + i/k映射到上/下键,使用以下代码:
!i:: Send {up}
!k:: Send {down}
Run Code Online (Sandbox Code Playgroud)
这些重映射适用于除2016年Onenote之外的所有应用程序.我在线查看并在以下链接中找到了一些讨论:
https://autohotkey.com/board/topic/15307-up-and-down-hotkeys-not-working-for-onenote-2007/
https://autohotkey.com/board/topic/41454-remap-key-doesnt-work-in-ms-onenote/
他们建议使用sendplay或sendraw,但这些对我不起作用.谁能帮我这个?
该AutoHotkey的初级教程包括示例脚本演示窗口具体的热键和热字串.
#IfWinActive ahk_class Notepad
::msg::You typed msg in Notepad
#IfWinActive
#IfWinActive untitled - Paint
::msg::You typed msg in MSPaint!
#IfWinActive
Run Code Online (Sandbox Code Playgroud)
第二个例子是相当不言自明的:检查一个名为"untitled - Paint"的窗口.这是第一个使用的例子ahk_class让我感到困惑.
我无法在AHK文档中找到对变量的任何解释.根据AHK论坛帖子,ahk_class是Windows Spy给出的窗口名称,帖子没有详细说明.
使用ahk_class Notepad和之间会有什么区别Untitled - Notepad吗?如果替换为第二个例子会有效#IfWinActive ahk_class Paint吗?
什么是ahk_class如何以及如何将其用于窗口匹配?
我一直在激活Firefox然后按Ctrl+ L来聚焦位置栏并进行搜索或输入URL.
理想情况下,我可以在任何应用程序中点击Ctrl+ L和Firefox将激活,位置栏集中并准备输入.在步骤AutoHotkey脚本.
我试过这个,似乎没有用.从我所读到的,代字号是"传递":
^l::
IfWinExist ahk_class MozillaUIWindowClass
{
WinActivate
Send ~^l
}
Run Code Online (Sandbox Code Playgroud) 我刚刚发现了AutoHotKey,它似乎成了梦想.我有两个.ahk脚本,A.ahk和B.ahk.我想从脚本A中调用脚本B.
AHK论坛在这个问题上非常沉默,但我确信这是可能的.
我正在尝试使用autohotkey在PC(Windows)键盘上模拟Mac键盘的元素.对于像复制和粘贴这样的简单任务,我的肌肉记忆达到Command键,所以我想将左侧的Alt +字母组合键重新映射到适当的ctrl +字母.
<!c::Send ^c
Run Code Online (Sandbox Code Playgroud)
大部分时间它工作正常,除了IE和Office应用程序的部分时间.当按下左Alt时,它会复制办公室功能区/菜单(即IE中显示的菜单栏,或Office 2010中出现的功能区字母),并且触发的ctrl +字母组合未到达目标.
我已经阅读了AHK常见问题解答+论坛,尝试了一些UP和$修饰符选项到热键,但它没有解决问题.有任何想法吗?
我正在尝试用我的AutoHotkey应用程序播放24位音频文件.它只使用SoundPlay.Windows 7没有问题,但Windows XP用户无法播放24位文件.
该文件说:
所有Windows操作系统都应该能够播放.wav文件.但是,如果操作系统上未安装正确的编解码器或功能,则其他文件(.mp3,.avi等)可能无法播放.
文章中提到的可能的修复方法如何在Windows Media Player中播放24位WAV文件正在修复Windows Media Player的问题,但不适用于autohotkey:
分步指南
预期行为:Windows Media Player和AutoHotkey应用程序中的音频文件回放没有错误.实际行为:仅在Windows Media Player中播放没有错误的音频文件,并且不在Windows XP下的AutoHotkey应用程序中播放.
进一步的调查
正如AutoHotKey论坛中所提到的,SoundPlay在底层使用mciSendString,可以通过直接调用来获取有关错误性质的更多信息.
使用mciSendString替代DLL调用我得到错误消息320,它对应于MCIERR_WAVE_OUTPUTSINUSE
所有可以播放当前格式文件的波形设备都在使用中.等到其中一个设备空闲; 然后,再试一次.
如何在AutoHotkey应用程序中在Windows XP中播放24位音频文件?
基于SoundPlay的测试应用(下载)
#NoEnv
SetWorkingDir %A_ScriptDir%
FileSelectFile, f
SoundPlay, %f%
Msgbox, You should hear audio - except for 24bit wave files under Windows XP.
Run Code Online (Sandbox Code Playgroud)
基于MCI的测试应用程序(下载)
#NoEnv
SetWorkingDir %A_ScriptDir%
FileSelectFile, f …Run Code Online (Sandbox Code Playgroud) 有没有办法从autohotkey发送一些参数到python.
使用Autohot键我从记事本中读取了一些数字并存储在变量中,现在我想将这个数字发送到python代码以进行一些计算.
我的Autohotkey代码是:
controlGetText, telphoneNumber, Edit1, Untitled - Notepad
Run Code Online (Sandbox Code Playgroud)
我想把它发送telphoneNumber到python文件.
有没有办法可以做到这一点?
我是否需要创建一个python的exe文件,然后从autohotkey调用?例如:
RunWait, C:\Button\button.exe telphoneNumber
Run Code Online (Sandbox Code Playgroud)
或者我需要从autohotkey运行命令提示符命令来运行python程序?就像是:
Run Cmd Python C:\Button\button.py telphoneNumber
Run Code Online (Sandbox Code Playgroud)
我不知道哪个是最好的方式,因为我是Autohotkey的新手.
任何建议将不胜感激.
编辑:
但是我成功通过使用来自autohotkey的run命令发送参数,该命令将从命令提示符执行python文件.
Run Cmd \k "Python C:\Button\button.py %telphoneNumber%"
Run Code Online (Sandbox Code Playgroud)
但是仍然想知道这是否是正确的解决方案,还是有其他解决方案?
我想用AutoHotkey更改我的显示器输入源,我有部分工作.但是,当我使用热键将监视器输入源从PC(DVI)更改为我的xbox(YPbYr)时,监视器未检测到xbox已打开,它表示没有来源.
Monitor =>华硕vg236
VCP Monitor输入我的显示器的源代码:
我正在使用Windows API Monitor配置函数,特别是使用DDC/CI的SetVCPFeature函数.
经过一些研究后,我决定要设置VCP输入源,这里有一些有用的信息,特别是关于输入源的第71页.
AutoHotkey代码:
setMonitorSource(source)
{
; Initialize Monitor handle
hMon := DllCall("MonitorFromPoint"
, "int64", 0 ; point on monitor
, "uint", 1) ; flag to return primary monitor on failure
; Get Physical Monitor from handle
VarSetCapacity(Physical_Monitor, (A_PtrSize ? A_PtrSize : 4) + 128, 0)
DllCall("dxva2\GetPhysicalMonitorsFromHMONITOR"
, "int", hMon ; monitor handle
, "uint", 1 ; monitor array size
, …Run Code Online (Sandbox Code Playgroud) Window Store应用程序与经典Windows应用程序不同.后者通常安装在C:\ Program Files下的清晰路径上.因此,AutoHotKey(AHK)脚本可以通过"运行"使用应用程序可执行文件的路径来运行经典应用程序.但是,似乎没有简单的Windows Store应用程序可执行文件路径.那么,如何使用简单的方法在AutoHotKey脚本中启动Windows应用商店应用呢?
autohotkey ×10
audio ×1
codec ×1
ctrl ×1
include ×1
mci ×1
onenote ×1
python ×1
scripting ×1
winapi ×1
windows ×1
windows-10 ×1
windows-xp ×1