Based on this Super User question, try simply using ^t::
in place of +insert::msgbox ctrl+t
. Also note that the proper regular expression appears to (roughly) be (.*)OneNote(.*)
, as OneNote
always seems to be included in the Window Title (ONENOTE.EXE
is the executable name).
How can I disable the Ctrl + T
shortcut in OneNote using AutoHotKey?
Generally speaking, the following script should block the Ctrl + T
shortcut in OneNote:
; use regular expressions for matching titles
SetTitleMatchMode,RegEx
#IfWinActive, (.*)OneNote(.*)
^t::
#IfWinActive
Note that if you have this script running, nothing should happen when you press Ctrl + T
. You can verify that the script is working by assigning ^t::
a message box:
; use regular expressions for matching titles
SetTitleMatchMode,RegEx
#IfWinActive, (.*)OneNote(.*)
^t::msgbox Sorry, Ctrl + T has been disabled!
#IfWinActive