Skip to content

Commit

Permalink
fix: OneNote2016 按回车后1秒内,如果出现了安全警告窗口,则自动按 Yes
Browse files Browse the repository at this point in the history
  • Loading branch information
snomiao committed Apr 10, 2021
1 parent 6b1db7e commit f581142
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions Modules/应用-OneNote2016增强.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ $#!n:: OneNote2016_OpenHomePage()
$#+n:: OneNote2016_OpenSearch()
OneNote2016_OpenSearch(){
winTitle := "ahk_class Framework`:`:CFrame ahk_exe ONENOTE.EXE"
needActive := 0
hWnd := WinActive(winTitle)
needActive := 1
hWnd := WinExist(winTitle)
if(!hWnd){
SendEvent #n
WinWaitActive %winTitle%, , 1 ; wait for 1 seconds
Expand Down Expand Up @@ -249,8 +249,17 @@ OneNote2016_OpenSearch(){
!+s:: CopySearchResultSectionAndPagesThenPaste()
!s:: CopySearchResultSectionAndPages()

#If ((CapsLockXMode != CM_CapsLockX && CapsLockXMode != CM_FN) && WinActive(".*- OneNote ahk_class Framework\:\:CFrame ahk_exe ONENOTE.EXE"))
; 自动2维化公式
#If !CapsLockXMode && WinActive(".*- OneNote ahk_class Framework\:\:CFrame ahk_exe ONENOTE.EXE")

; 按回车后1秒内,如果出现了安全警告窗口,则自动按 Yes
$~Enter::
waitWindow := "ahk_class NUIDialog ahk_exe ONENOTE.EXE"
WinWaitActive %waitWindow%,, 1
if (!ErrorLevel)
SendEvent !y
Return

; 自动2维化公式
$!-::
SendEvent !=
Sleep, 200
Expand Down

0 comments on commit f581142

Please sign in to comment.