Created
January 12, 2009 21:52
-
-
Save bomberstudios/46187 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A Python plugin for VoodooPad. | |
# It searches for tag_name appearances in your document and adds the text after it to | |
# a new list_page page. | |
VPScriptSuperMenuTitle = "GTD" | |
VPScriptMenuTitle = "Update @todo list" | |
VPShortcutKey = "T" | |
VPShortcutMask = "control" | |
import time | |
tag_name = "@todo" | |
list_page = "autotasks" | |
def main(windowController, *args, **kwargs): | |
theList = "Task List\n\n" | |
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(tag_name) >= 0: | |
theList = theList + page.displayName() + line.partition(tag_name)[2] + "\n" | |
theList = theList + "\n\n--\nUpdated at " + time.strftime("%d %b %Y %H:%M",time.localtime()) | |
page = document.pageForKey_(list_page) | |
page.setDataAsString_(theList) | |
document.openPageWithTitle_(list_page) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment