tell application "TextWrangler" activate select text 1 of project window 1 copy selection make new text document at project window 1 paste activate set the_text to text of document 1 set myDelim to "\"" set oldDelimiters to AppleScript's text item delimiters set AppleScript's text item delimiters to myDelim set myName to text item 8 of the_text set myNickNameLower to ¬ (do shell script ("echo " & myName & " | tr [a-z] ' ' | sed '/ /s///g' | tr [A-Z] [a-z];")) set myITblog to ¬ (do shell script ("echo " & myName & " | tr ' ' '-' | tr [A-Z] [a-z];")) set myUrl to text item 10 of the_text set myImageUrl to text item 16 of the_text set AppleScript's text item delimiters to oldDelimiters set cannedResponseTop to "[caption id=\"\" align=\"alignnone\" width=\"220\" caption=\"New " & myName & "\"]\"New[/caption]

Yesterday's " & myName & " ...

You can also see this play out at WordPress 4.1.1's New " & myName & " ...


Previous relevant " & myName & " is shown below.

" set cannedResponseBottom to "

If this was interesting you may be interested in this too.

" set text of document 1 to cannedResponseTop & return & the_text & return & cannedResponseBottom activate select insertion point before line 1 of window 1 activate set filen to "Macintosh HD:Applications:MAMP:htdocs:aaa_new_" & myNickNameLower & ".txt" save text document 1 to file filen without saving as stationery set the clipboard to "New " & myName set the_new_text to text of document 1 set the clipboard to the_new_text end tell