在onenote 2013上更改字體顏色的鍵盤快速鍵?

在onenote 2013上更改字體顏色的鍵盤快速鍵?

有沒有辦法使用鍵盤快速鍵來更改 OneNote 中的字體顏色?

(我希望它將突出顯示的字體變成不同的顏色,這樣如果我開始輸入它就會改變顏色)。

答案1

在 OneNote 中,如果您可以使用按鍵順序切換到所需的顏色,那麼您可以將它們放在一起自動熱鍵宏。

例如,在 OneNote 2013 英文中,我可以透過傳送以下指令切換到紅色字型顏色(RGB 值 = 255,0,0):

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

所以這裡有一些範例宏:

  • Ctrl+ Alt+ P=紫色的- 從顏色樣本中選取(將顏色重設為自動的在那之前)
  • Ctrl+ Alt+ R=紅色的- 透過選擇更多顏色...並輸入 RGB 值 255, 0, 0
  • Ctrl+ Alt+ B=藍色的- 透過選擇更多顏色...並輸入 RGB 值 0、0、255
  • Ctrl+ Alt+ A=自動的- 選擇自動的在色樣頂部找到的顏色

完整清單(使用複製貼上):

; 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

已測試,效果很好!

這樣,您可以將鍵盤快捷鍵指派給 OneNote 或其他應用程式中的幾乎任何操作。

(如果您不熟悉正規表示式,可以簡化視窗標題匹配。SetTitleMatchMode命令參見幫助。並省略$from OneNote$。)

答案2

這是我對相同想法的看法,但對 OneNote 的工作方式進行了改進,特別是當涉及到顏色視窗的行為方式時,您無法動態切換顏色,因為它保留在同一選項卡上。
另外,我添加了一個矩陣,這樣您就可以輕鬆修改顏色,而無需修改內聯數字。

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
; some helpful setup first
SetTitleMatchMode, RegEx ; match window titles by regular expressions

#IfWinActive - OneNote$ ; ------ only in windows with title ending with "- OneNote"
; change the number in "RGB :=" between  [#,#,#] using RGB colorspace 
{
    {
    ^!p::
        RGB := [167,21,157] ; purple
        Send !hfcm^{PgDn}!r
        Send % RGB[1]
        Send {Tab}
        Send % RGB[2]
        Send {Tab}
        Send % RGB[3]
        Send {Enter}{Right 1}
        GoSub, ^!a
    return
    }
    {
    ^!r::
        RGB := [255,0,0] ; Red
        Send !hfcm^{PgDn}!r
        Send % RGB[1]
        Send {Tab}
        Send % RGB[2]
        Send {Tab}
        Send % RGB[3]
        Send {Enter}{Right 1}
        GoSub, ^!a
    return
    }
    {
    ^!o:: 
        RGB := [235,110,26] ; Dark Orange
        Send !hfcm^{PgDn}!r
        Send % RGB[1]
        Send {Tab}
        Send % RGB[2]
        Send {Tab}
        Send % RGB[3]
        Send {Enter}{Right 1}
        GoSub, ^!a
    return
    }
    {
    ^!b::
        RGB := [0,0,255] ; Blue
        Send !hfcm^{PgDn}!r
        Send % RGB[1]
        Send {Tab}
        Send % RGB[2]
        Send {Tab}
        Send % RGB[3]
        Send {Enter}{Right 1}
        GoSub, ^!a
    return
    }
    {
    ^!c::
        RGB := [91,155,213] ; cyan
        Send !hfcm^{PgDn}!r
        Send % RGB[1]
        Send {Tab}
        Send % RGB[2]
        Send {Tab}
        Send % RGB[3]
        Send {Enter}{Right 1}
        GoSub, ^!a
    return
    }

^!a::Send !hfca ; automatic color (i.e. reset font color to "none")

; #IfWinActive ; ------ end of section restricted to specific window
}

希望它對某人有用。

答案3

我有瑞典語版本OneNote2016,所以這是我在 AutoHotKey 中使用的「代碼」(因為鍵盤命令與英文版 OneNote 中的不同)。 感謝 miroxlav,他在回答中為我提供了最初的線索,我剛剛在 Onenote2016 的瑞典語版本中採用了它

^!p::Send, !wfel^{PgDn}!r167!ö21!b157{Enter} ; purble (167, 21, 157)
^!r::Send, !wfel^{PgDn}!r255!ö0!b0{Enter} ; red (255, 0, 0)
^!b::Send, !wfel^{PgDn}!r0!ö0!b255{Enter} ; blue (0, 0, 255)
^!g::Send, !wfel^{PgDn}!r0!ö135!b0{Enter} ; green (0, 135, 0)
^!a::Send, !wfea ; automatic color

..所以你嘗試的是在你的筆記中按“Alt”,看看哪些字母出現在你改變顏色的菜單中。如果需要的話,我可以製作一個簡短的影片來說明如何做到這一點。現在它起作用了,我絕對完美!

相關內容