有没有办法在一个自动热键中写一个自动热键?例如,我有一个自动热键,可以在工作时在标签页中打开一些网站;我有一个自动热键,键入后可以输入其中一些网站的用户名和密码。有没有办法将密码自动热键(actd(at符号))放入IE标签的自动热键中?我做了一些搜索,看起来{@}不能发送,所以我不确定是否有其他方法。
发布于 2013-04-16 14:00:14
你的AutoHotKey脚本可以持久化其他脚本,假设它们不是# #Include。您可以遍历选项卡列表,然后调用一个或多个其他脚本。
就发送@符号而言,您应该能够顺利地使用Send命令。如果确实遇到奇怪的问题,可以尝试使用SendRaw命令或语法:Send {raw}@
如果这不能回答你的问题,请粘贴一些你想要工作的代码。
发布于 2014-12-22 23:06:28
你能做的就是写两个独立的脚本。没有分配自动热键,但由初始脚本调用。在您的例子中,您已经说过您已经有了一个to打开热键,所以我将使用这两个脚本的一个非常简单的示例,但演示如何发送@符号并从热键中调用另一个脚本。
我将使用的两个脚本是:tabOpener.ahk和passwordEntry.ahk
它们将显示如下:
tabOpener.ahk
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; hotkey is set as WinowsKey+t and checks if FireFox exists, if so, it makes it active, if not, it starts FireFox
~#t::
IfWinExist, ahk_class MozillaWindowClass
{ WinActivate
Send ^t
} else run firefox
;Upon opening a new tab in FireFox, the address bar has already got focus,
;so send the web address (You can use COM functions for this, and are highly
;recommended, but out of the scope of this example)
Send, hotmail.com{Enter}
;Waits until page is loaded. Again COM functions are available as they can tell
;when a page is finished loading, but that is a more involved example.
Sleep 5000
;Calls the password entry script.
Run passwordEntry.ahk
returnpasswordEntry.ahk
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
;When using send, adding the {Raw} tag will literally interpret every
;character in the remainder of a string. For instance ^ will send ^
;instead of a Control keypress.
Send {Raw}Username@domain.tld
Send {Tab} {Raw}Password希望这能有所帮助。这个示例展示了除了使用Run / Runwait (http://www.autohotkey.com/docs/commands/Run.htm)从现有热键中调用单独的脚本外,还使用{Raw}标记发送特殊字符(http://www.autohotkey.com/docs/commands/Send.htm)。
发布于 2015-04-07 23:39:53
;~ Alt+1 to send username (email format) and password
!1::Send, myUsername@mydomain.com{tab}myPassword{enter}https://stackoverflow.com/questions/13607603
复制相似问题