Typora 快捷方式给字体设置颜色

下载并安装 AutoHotkey(具体步骤可自行百度)

1)访问 AutoHotkey 主页

https://autohotkey.com

2)点击下载: 

https://autohotkey.com/download/ahk-install.exe

桌面新建文件 MyHotkeyScript.ahk 将以下代码复制进去保存

注意文件后缀.ahk

; 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中自动补全标签
    }
}

双击运行(使用AutoHotkey运行)

然后去Typora 按快捷键试试吧!!!

选择要设置颜色的文字,按Ctrl+Alt+o添加橙色,按Ctrl+取消样式!



知识共享许可协议本作品采用知识共享署名-相同方式共享 4.0 国际许可协议进行许可。

相关推荐

【教程】卸载1Panel

1、卸载1Panel命令行 ✅只要在Linux终端输入1pctl uninstall就能卸载掉1panel。 💥上面的卸载命令行,百度和官网找都找 ...

暂无评论

目录展开