I take notes at meetings in VoodooPad, and as such I write a lot of to-do items in MeetingNotes pages. They tend to get buried in those pages unless I do something about it fast. Sometimes I put them somewhere more useful, like on my “TodoToday” page, but that page is getting more like a “TodoSomeday” page, and isn’t fit for serious action items. Today I realized that I wanted a script to take line-items from VoodooPad pages and make them into Todo items in iCal, so I can track them easier.
I already have a Quicksilver plugin for creating new todos, so I repurposed it as a python plugin for VoodooPad to add a big list all at once. Check out Gus’ post on python plugins for the enabler, and then check this sucker out:
VPScriptSuperMenuTitle = "Notes" VPScriptMenuTitle = 'Create Todos in iCal'
import os
def main(windowController, *args, **kwargs): tv = windowController.textView() s = tv.string() ranges = tv.selectedRanges()
scriptString = ""
for r in ranges:
rs = s.substringWithRange_(r.rangeValue())
lines = rs.split("\n")
for line in lines:
if len(line) < 1: continue
scriptString += "tell application \"iCal\"\n\
set theCal to (first calendar whose title is \"Work\")\n\
make todo at end of todos of theCal with properties\
{priority:0, summary:\"%s\"}\n\
end tell\n" % line
f = os.popen("/usr/bin/osascript", 'w')
f.write(scriptString)
f.close()
Want to add to it? These and many things are easily imaginable:
- Change priority based on the first character of each line
- handle continuation lines better
- change calendar to select based on some simple syntax, like “* foo” is a line with text “foo” but “*foo bar” is a line with text “bar” destined for calendar “foo”…
- Another idea: a line starting with the words “email” or “mail” be made into a todo with the glyph ✉, and/or an actual email in Mail.app.
- Any other ideas?
Walt 8:35 am on September 22, 2006 Permalink
Michael, this sounds like precisely what’s required to take VP the “last mile” to becoming a complete solution for GTD; the Address Book integration is sufficient, but i must send ToDos from VP to iCal for this to work in my case (because of the smart phone imperative, as described by “tavilach” at http://www.flyingmeat.com/board/viewtopic.php?p=2360 ; obviously i’m not the only one in need of this). Only problem is (as i said in aforecaptioned thread), i don’t know how to plug-in this script you posted above (tho i’ve got PythonPluginEnabler installed and working) – so if you would be so good as to advise (by email, if not to aforecaptioned thread to which i’ve subscribed), i’d be much obliged. Thanks!
mike 12:07 pm on September 22, 2006 Permalink
Walt, install it by saving the script into ~/Library/Application Support/VoodooPad/Script PlugIns/
I’ll reply by email too but this is here for posterity.
Also, I can’t guarantee it works with VP3. I can’t test it right now.
Walt 12:10 pm on September 25, 2006 Permalink
Hey, Mike: Thanks for the superquick response – which seems perfectly consistent with advice that Gus has also provided over on the FM board (he also advised to give the file a .py extension, and restart VP, which i did). Unfortunately (as i said in my answer to Gus on FM board – see http://flyingmeat.com/board/viewtopic.php?p=2366#2366 ), it did not work. Maybe it’s related because i’m using version 3.1.0 (1091), if you think that matters… But isn’t there some .pyc file that must accompany the .py script, if related function(s) are to be available in the VP interface? Obviously i’m weak in my understanding of the architecture here (as a user, not a programmer), but i can follow instructions like a good dog, if i can get somebody to spoonfeed me step-by-step… Any chance of that here? :-)
Unproductivity » links for 2007-10-26 6:25 pm on October 25, 2007 Permalink
[...] Voodoopad lines to iCal todos “…script to take line-items from VoodooPad pages and make them into Todo items in iCal…” (tags: applescript gtd howto ical mac osascript osx productivity program programming python script todo voodoopad unproductivity.org) [...]