在Typero中修改字体的颜色

在Typero中修改字体的颜色

参考链接

https://blog.csdn.net/superit401/article/details/106344453/

  1. 安装AutoHotKey https://autohotkey.com/download/ahk-install.exe
  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中自动补全标签
    }
}

  1. 将文件保存为ahk后缀文件
  2. 双击运行
  3. 在Typero软件里可以使用快捷键, Ctrl+Alt+O添加橙色, Ctrl+Alt+R添加红色, Ctrl+取消样式
  4. 可以参考模板自定义颜色快捷键
原文地址:https://www.cnblogs.com/happysml/p/13897313.html