Yay Shell Posting!

January 30th, 2003  |  Published in Uncategorized

New tools are always fun. mtsend.py is a Python script for command-line posting to Movable Type ‘blogs. You just edit a plain text file then feed it to the script. It also does basic ‘blog info retrieval. I’m working on some scripts to use with the Mac script menu and BBEdit.

For starters, I guess, here’s an AppleScript that dumps the contents of BBEdit into a tmp file then pipes that through the script (which requires, unfortunately, piped text and a specified operation via a switch):

tell application "BBEdit"

save front window to "Macintosh HD:Users:mph:.blog.tmp"

do shell script

("cat /Users/mph/.blog.tmp | /Users/mph/bin/mtsend.py -N")

end tell

display dialog "Entry Uploaded"

buttons("OK")

mtsend.py also offers the ability to retrieve a list of categories, recent entry numbers, and a few other things, all of which are pretty good candidates for a little editor-centered automation.

Comments are closed.

© Michael Hall, licensed under a Creative Commons Attribution-ShareAlike 3.0 United States license.