如果 win 存在,如何在 AutoHotKey 中找到 OneNote windows 10?
How to find OneNote windows 10 in AutoHotKey's if winexist?
我正在尝试构建一个脚本,允许我使用热键打开和使用 OneNote(商店应用程序,而不是 OneNote 2016),但我想使用相同的热键从另一个应用程序切换应用程序 window。我已经用许多其他程序完成了此操作,但从未使用 windows 商店应用程序。这是我正在尝试使用的代码。
#If WinExist("OneNote ahk_class ApplicationFrameWindow", "OneNote")
{
WinActivate,
}
Else
Run, C:\Users\ChrisCochrun\Documents\OneNote
#If
不幸的是,它没有检测到 window 存在,它只会启动一个新的 onenote 实例。我一直在寻找答案,但我很难找到答案,因此 AHK 实际上已经 运行 看到 window 并跳转到它。
非常感谢您的帮助!
如果 window 的标题不是以 "OneNote" 开头,您需要使用
SetTitleMatchMode 2.
#If-directive 仅用于创建 context-sensitive 热键和热字串。
F1:: ; or a hotkey of your choise
SetTitleMatchMode 2
If WinExist("OneNote ahk_class ApplicationFrameWindow", "OneNote")
WinActivate
Else
Run, C:\Users\ChrisCochrun\Documents\OneNote
return
rshfit::
SetTitleMatchMode 2
If WinExist("OneNote for Windows 10")
WinActivate return
;If I use rshift to activate Onenote for Windows 10
我正在尝试构建一个脚本,允许我使用热键打开和使用 OneNote(商店应用程序,而不是 OneNote 2016),但我想使用相同的热键从另一个应用程序切换应用程序 window。我已经用许多其他程序完成了此操作,但从未使用 windows 商店应用程序。这是我正在尝试使用的代码。
#If WinExist("OneNote ahk_class ApplicationFrameWindow", "OneNote")
{
WinActivate,
}
Else
Run, C:\Users\ChrisCochrun\Documents\OneNote
#If
不幸的是,它没有检测到 window 存在,它只会启动一个新的 onenote 实例。我一直在寻找答案,但我很难找到答案,因此 AHK 实际上已经 运行 看到 window 并跳转到它。
非常感谢您的帮助!
如果 window 的标题不是以 "OneNote" 开头,您需要使用 SetTitleMatchMode 2.
#If-directive 仅用于创建 context-sensitive 热键和热字串。
F1:: ; or a hotkey of your choise
SetTitleMatchMode 2
If WinExist("OneNote ahk_class ApplicationFrameWindow", "OneNote")
WinActivate
Else
Run, C:\Users\ChrisCochrun\Documents\OneNote
return
rshfit::
SetTitleMatchMode 2
If WinExist("OneNote for Windows 10")
WinActivate return
;If I use rshift to activate Onenote for Windows 10