首页 > 其他 > 详细

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

时间:2021-03-11 10:35:31      阅读:40      评论:0      收藏:0      [点我收藏+]

来自:技术好学屋

下载并安装 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+\取消样式!

 

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

原文:https://www.cnblogs.com/googlem/p/14515693.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!