02)<em>.applescript
来自「Mac OS X 平台一文本编辑器的源代码」· APPLESCRIPT 代码 · 共 32 行
APPLESCRIPT
32 行
(* written by nakamuxu. 2005.03.14 *)--property beginStr : "<em>"property endStr : "</em>"property preMargin : 0----tell application "CotEditor" if exists front document then set {loc, len} to range of selection of front document if (len = 0) then set newStr to beginStr & endStr if (preMargin = 0) then set numOfMove to count of character of beginStr else set numOfMove to preMargin end if else if (len > 0) then set curStr to contents of selection of front document set newStr to beginStr & curStr & endStr if (preMargin = 0) then set numOfMove to count of character of newStr else set numOfMove to preMargin end if else return end if set contents of selection of front document to newStr set range of selection of front document to {loc + numOfMove, 0} end ifend tell
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?