gpt4 book ai didi

With autoHotKey code, how can I write a function that receives the autohotkey command text as a parameter and executes it?(使用AutoHotKey代码,我如何编写一个将AutoHotkey命令文本作为参数接收并执行它的函数?)

转载 作者:bug小助手 更新时间:2023-10-27 20:26:55 24 4
gpt4 key购买 nike



for example I want to pass ANY ahk command text like "Click, 50, 50" or "MsgBox test",,, into a function and execute that command. Is it possible?

例如,我希望将任何ahk命令文本(如“Click,50,50”或“MsgBox test”、、)传递到一个函数中并执行该命令。有可能吗?


更多回答
优秀答案推荐

This may help you.

这可能对你有帮助。


#SingleInstance, Force

var := "example"
new_instance( "msgbox " var " 1`nexitapp" )
new_instance( "msgbox % ""another " var " 2"""
. "`nexitapp" )
new_instance( "msgbox another example 3`nexitapp" )
new_instance( "msgbox passing var`n"
. "var := """ var " 4""`n"
. "Msgbox % var `n"
. "exitapp" )

ExitApp, 0

new_instance( Script ) {

OutputDebug, % script ; for debug purpose
shell := ComObjCreate( "WScript.Shell" )
exec := shell.Exec( A_AhkPath " /ErrorStdOut *")
exec.StdIn.Write( script )
exec.StdIn.Close()

}

更多回答

It goes well. I thought this was an impossible feature. I appreciate it.

一切都很顺利。我认为这是一个不可能的功能。我很感激。

But shouldn't it be the case of "MouseMove, 10, 10, Relative"? I'm getting an error. Isn't that code applicable to all other AHK commands?

但这不应该是“鼠标移动,10,10,亲戚”的情况吗?我收到一个错误。该代码难道不适用于所有其他AHK命令吗?

new_instance( "MouseMove, 10, 10, Relative`nexitapp" ) It's working quite well for me on 1.1.36.02 V1.It's applicable to any code, but it's important to note that each code sent to this function is treated as a new instance. Therefore, it's advisable to review the output code carefully. Can you post your function call?

NEW_INSTANCE(“MouseMove,10,10,Relative`nexitapp”)它在1.1.36.02 V1上运行得很好,它适用于任何代码,但重要的是要注意,发送到该函数的每个代码都被视为新的实例。因此,建议仔细检查输出代码。你能发布你的函数调用吗?

I must have done something wrong. Now that's great. I appreciate it

我一定是做错了什么。这太好了。我很感激

Can this script be run in an environment where autohotkey is not installed?That's because there seems to be an error in the A_AhkPath part in an environment where autohotkey is not installed. Is all I need is the autohotkey.exe file?

此脚本可以在未安装自动热键的环境中运行吗?这是因为在未安装自动热键的环境中,A_AhkPath部分似乎存在错误。我只需要Autohotkey.exe文件吗?

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com