【问题标题】:How to find OneNote windows 10 in AutoHotKey's if winexist?如果 wine 存在,如何在 AutoHotKey 中找到 OneNote windows 10?
【发布时间】:2020-07-16 16:04:54
【问题描述】:

我正在尝试构建一个脚本,允许我通过热键打开和使用 OneNote(商店应用程序不是 OneNote 2016),但我想使用相同的热键从另一个窗口切换应用程序。我已经通过许多其他程序实现了这一点,但从未使用 Windows 商店应用程序。这是我正在尝试使用的代码。

#If WinExist("OneNote ahk_class ApplicationFrameWindow", "OneNote")
{
  WinActivate,
}
Else
  Run, C:\Users\ChrisCochrun\Documents\OneNote
#If

不幸的是,它没有检测到窗口存在,它只会启动一个新的 onenote 实例。我一直在寻找答案,但我无法让 AHK 真正看到窗口已经在运行并跳转到它。

非常感谢您的帮助!

【问题讨论】:

    标签: autohotkey windows-10-universal


    【解决方案1】:

    如果窗口标题不以“OneNote”开头,则需要使用 SetTitleMatchMode 2.

    #If-directive 仅用于创建上下文相关的热键和热字串。

    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
    

    【讨论】:

    • 太棒了!就是这样!我忘记了 SetTitleMatchMode 2。谢谢!
    【解决方案2】:

    rshfit:: 
    SetTitleMatchMode 2 
    If WinExist("OneNote for Windows 10") 
    WinActivate return
    
    ;If I use rshift to activate Onenote for Windows 10

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-03-19
      • 2016-03-13
      • 1970-01-01
      • 2016-06-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多