| 1 | #Requires AutoHotkey v2.0 |
| 2 | OnError((exception, mode) => (FileAppend(exception.Message, "**"), ExitApp(1))) |
| 3 | hwnd := WinExist("ahk_class Framework::CFrame ahk_exe ONENOTE.EXE") |
| 4 | if !hwnd |
| 5 | throw Error("OneNote window is missing") |
| 6 | WinActivate(hwnd) |
| 7 | if !WinWaitActive(hwnd,, 5) |
| 8 | throw Error("OneNote window is not active") |
| 9 | Send "{Left}" |
| 10 | SendText "UI " |