zoukankan      html  css  js  c++  java
  • [other] AutoHotKey.ahk

    typora通过AutoHotKey软件设置Alt+(o/r/b/g/y)对选中字段添加对应颜色的快捷键

    ; Typora
    ; 快捷增加字体颜色
    ; SendInput {Text} 解决中文输入法问题
    
    #IfWinActive ahk_exe Typora.exe
    {
        ; Alt+o 橙色
        !o::addFontColor("orange")
    	
    	; Alt+y 黄色
        !y::addFontColor("yellow")
    
        ; Alt+r 红色
        !r::addFontColor("red")
    
        ; Alt+b 浅蓝色
        !b::addFontColor("cornflowerblue")
    	
    	; Alt+g 绿色
    	!g::addFontColor("green")
    }
    
    ; 快捷增加字体颜色
    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中自动补全标签
        }
    }
    
    
  • 相关阅读:
    常用的Dos命令
    关于CSS3
    数据渲染
    jQuery中的AJAX
    AJAX
    面向对象3
    克隆对象、对象继承
    面向对象2
    面向对象1
    面向对象
  • 原文地址:https://www.cnblogs.com/aaronbin/p/15567388.html
Copyright © 2011-2022 走看看