Keyboard shortcut to change font colour on onenote 2013

microsoft-onenote

Is there a way to change the colour of the font in onenote using a keyboard shortcut?

(I want it to turn both highlighted font into a different colour and such that if i start to type it will change colour).

Best Answer

In OneNote, if you can switch to desired color using sequence of keystrokes, then you can put these together into an AutoHotKey macro.

For example, in OneNote 2013 English, I am able to switch to red font color (with RGB value = 255,0,0) by sending:

Alt+h, f, c, m, Ctrl+PgDn, Alt+r, 2, 5, 5, Tab, 0, Tab, 0, Enter

So here you have few sample macros:

  • Ctrl+Alt+P=purple - picked from color swatches (resets color to Automatic before that)
  • Ctrl+Alt+R=red - by choosing More colors... and entering RGB values 255, 0, 0
  • Ctrl+Alt+B=blue - by choosing More colors... and entering RGB values 0, 0, 255
  • Ctrl+Alt+A=automatic - chooses Automatic color found on top of color swatches

The complete listing (use copy-paste):

; some helpful setup first
SetTitleMatchMode, RegEx ; match window titles by regular expressions

#IfWinActive - OneNote$ ; ------ only in windows with title ending with "- OneNote"

^!p::Send !hfca!hfc{Down 7}{Right 4}{Enter}
^!r::!hfcm^{PgDn}!r255{Tab}5{Tab}0{Enter} ; red (255, 0, 0)
^!b::!hfcm^{PgDn}!r0{Tab}5{Tab}255{Enter} ; blue (0, 0, 255)
^!a::!hfca ; automatic color (i.e. reset font color to "none")

#IfWinActive ; ------ end of section restricted to specific windows

Tested, works nicely!

This way, you can assign keyboard shortcut to almost any action in OneNote or other apps.

(If you are not familiar with regular expressions, you can simplify window title matching. See help for SetTitleMatchMode command. And omit $ from OneNote$.)

Related Question