1.修改字体颜色
AutoHotKey是一款著名的windows系统快捷键设置的软件,轻便小巧。
官方下载: https://autohotkey.com/download/ahk-install.exe
(1)先安装AutoHotKey
(2)打开记事本,把如下内容复制粘贴进去:
; Typora ; 快捷增加字体颜色 ; SendInput {Text} 解决中文输入法问题 #IfWinActive ahk_exe Typora.exe { ; Ctrl+Alt+O 橙色 ^!o::addFontColor("orange") ; Ctrl+Alt+R 红色 ^!r::addFontColor("red") ; Ctrl+Alt+B 浅蓝色 ^!b::addFontColor("cornflowerblue") } ; 快捷增加字体颜色 addFontColor(color){ clipboard := "" ; 清空剪切板 Send {ctrl down}c{ctrl up} ; 复制 SendInput {TEXT}<font color='%color%'> SendInput {ctrl down}v{ctrl up} ; 粘贴 If(clipboard = ""){ SendInput {TEXT}</font> ; Typora 在这不会自动补充 }else{ SendInput {TEXT}</ ; Typora中自动补全标签 } }
(3)将文件保存为ahk后缀的文件,如TyporaHotKey.ahk
(4) 双击运行
(5)在Typora软件里就可以使用快捷键:
如按Ctrl+Alt+O
添加橙色,Ctrl+Alt+R 红色,按Ctrl+
取消样式!
也可以右键 MyHotkeyScript.ahk
脚本文件,点击Compile Script
编译脚本成exe
程序,就可以不用下载Autohotkey
在其他电脑上运行了。
上面脚本只写了橙色、红色、浅蓝三种颜色,你可以按需照例增加其他颜色或快捷方式!
参考文献:https://blog.csdn.net/superit401/article/details/106344453/