View Single Post
I couldn't solve it, so I changed the strategy - instead of the selection in the right pane, I am querying all tasks in OF through contexts. It works this way. This is first time I use ScriptingBridge, so I probably shouldn't get too excited... but man, this is really cool - adding functionality to your favorite app using your favorite programming language... :-)

In case anyone interested, my script tries to "visualize" time data from OF. The part I miss the most in GTD in general and in OF in particular is the ability to query my trusted system and withing 5 minutes answer the question "When can I expect it to be ready?"
So the script does the following:

- Loop through all tasks in OF and filter only those with due dates (or with parent that has due date)
- Create iCalendar vevent entry from every task, calculate start and end according to the deadline, duration of the task AND duration of other tasks (you can only do one thing at a time)
- Schedule those events ONLY during working hours (according to iCal setting)
That means that if I have two tasks, both 8 hours long, both with deadline on friday 9:00, one will be scheduled on wednesday, and one on thursday.
To make the updates more easy, the script serves generated iCalendar data on the fly through local Python http server. So I've subscribed to this local server (e.g. http://localhost:8888) in iCal, and now the calendar is auto-magically updated every 5 minutes with fresh data from OF.

I am only using it few hours now, but even at this point seeing my tasks automatically appear as scheduled blocks in iCal is awesome. A lot needs to be done, but when it's ready I'll package the script and release it, to share the joy :)