为BBEdit插入并关闭标记脚本
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了为BBEdit插入并关闭标记脚本相关的知识,希望对你有一定的参考价值。
I've used Textmate since I started hand-coding websites. My boss loves BBEdit. This script allows me to do the thing I missed most from Textmate creating and wrapping tags around text. Enjoy!
tell application "BBEdit" set theText to text of front text document set theSelection to the selection as string set theCharStart to (characterOffset of selection) set theResponse to text returned of (display dialog "Wrap what tags around selection?" default answer "" default button 2) set theTag to first word of theResponse --set theOther to chars((length of first word of theResponse) - end) of theResponse set tmpStr to "<" & theResponse & ">" & theSelection & "</" & theTag & ">" set the selection to tmpStr set insertionPosition to (theCharStart + (length of tmpStr)) --select (characters insertionPosition through (insertionPosition - 1)) of front text document select insertion point before character insertionPosition of front text document end tell
以上是关于为BBEdit插入并关闭标记脚本的主要内容,如果未能解决你的问题,请参考以下文章
将代码片段插入数据库并在 textarea 中以相同方式显示