The Shape of Everything
A website mostly about Mac stuff, written by August "Gus" Mueller
» Acorn
» Retrobatch
» Mastodon
» Micro.blog
» Instagram
» Github
» Maybe Pizza?
» Archives
» Feed
» Micro feed
July 17, 2007
(This post is from my old, old, super old site. My views have changed over the years, hopefully my writing has improved, and there is now more than a handful of folks reading my site. Enjoy.)

I've managed to finally make a universal binary of the "Python Plugin Enabler" for VoodooPad. And when I say "I did it!", what I really mean is Ian Baird did it by helping me out a ton, including submitting a patch for py2app. (Thanks Ian!)

You can grab the plugin from here: http://flyingmeat.com/download/plugin/PythonPlugin.vpplugin.zip

What this does is allow you to make short one-file plugins for VoodooPad written in Python. Here's a quick example, which creates a new page with the current date:

VPScriptSuperMenuTitle = "Python PlugIns" VPScriptMenuTitle = 'New Page With Current Date (python)'

import time

def main(windowController, args, *kwargs):     textView = windowController.textView()     document = windowController.document()     pageName = time.strftime('%Y.%m.%d')

    document.createNewVPDataWithKey_(pageName)     textView.insertText_(pageName)

You just put that in a file named something like "new_page_with_current_date.py", and stick it in: ~/Library/Application Support/VoodooPad/Script PlugIns/

and you are good to go.

(I should also acknowlege and thank Jonathan Wight, since he's the guy who originally wrote it. Thanks Jonathan!)