# -*- coding: utf-8 -*- ''' :Title @todo List :Author Flying Meat :Website http://flyingmeat.com/ :Planguage Python :Requires VoodooPad 3.5+ :Description Look for the word "@todo" in all the pages, and inserts the page name with the line. EOD ''' VPScriptMenuTitle = "List Pages with @todo" import AppKit def main(windowController, *args, **kwargs): theList = "" document = windowController.document() for key in document.keys(): page = document.pageForKey_(key) if page.uti() == "com.fm.page": attString = page.dataAsAttributedString() for line in attString.mutableString().splitlines(): if line.find("@todo") >= 0: theList = theList + "\n" + page.displayName() + ": " + line.strip() windowController.textView().insertText_(theList)