Skip to content

Instantly share code, notes, and snippets.

@rwilcox
Created March 31, 2012 22:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rwilcox/2269183 to your computer and use it in GitHub Desktop.
Save rwilcox/2269183 to your computer and use it in GitHub Desktop.
BBEdit Create Markdown Table Row with BBEdit
-- 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