Skip to content

Instantly share code, notes, and snippets.

@tjstankus
Created January 17, 2010 05:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tjstankus/279223 to your computer and use it in GitHub Desktop.
Save tjstankus/279223 to your computer and use it in GitHub Desktop.
# Hacking VoodooPad to create OpenMeta tags from VoodooPad page tags
#
# How to make this work:
# 1. Download the openmeta command line tool from here:
# http://code.google.com/p/openmeta/downloads/list
# Unzip the executable and install it to /usr/local/bin.
# If you choose a different directory, change the cmd string below.
# 2. Save the below Python code into
# ~/Library/Application Support/VoodooPad/Script Plugins/openmeta_tags.py
# 3. Quit and restart VoodooPad.
# 4. Run the OpenMeta Tags script from the Plugin menu.
import os
VPScriptMenuTitle = "OpenMeta Tags"
def main(windowController, *args, **kwargs):
document = windowController.document()
tags = []
for pageKey in document.keys():
page = document.pageForKey_(pageKey)
for tag in page.tagNames():
if tag not in tags:
tags.append(tag)
cmd = '/usr/local/bin/openmeta -a ' + ' '.join(tags) + ' -p "' + document.fileName() + '"'
os.system(cmd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment