Created
March 31, 2012 22:33
-
-
Save rwilcox/2269183 to your computer and use it in GitHub Desktop.
BBEdit Create Markdown Table Row with BBEdit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- by Ryan Wilcox, March 30, 2012, licensed under Public Domain | |
tell application "BBEdit" | |
tell window 1 | |
set theRes to display dialog "Create how many columns?" default answer "3" | |
set columnNum to (text returned of theRes as number) | |
set insertionP to get selection | |
set tableColumnText to "| <##> " | |
set tableRowText to "" | |
repeat columnNum times | |
set tableRowText to tableRowText & tableColumnText | |
end repeat | |
set tableRowText to tableRowText & "| <##>" | |
set text of insertionP to tableRowText & (text of insertionP) | |
select (first character of selection) | |
end tell | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment