View Single Post
Thanks a lot for all your suggestions, Rob! I definitely did not realize that available tasks are contained in contexts - once you pointed this out, I found that I can use
Code:
available tasks of flattened contexts whose flagged is true
to get exactly what I want. I see from some of your other work that this is probably not a very efficient way to get this list, and that I could use sqlite to query the cache directly even when OF isn't running. Fortunately for me, I specifically do not want my script to run unless OF is already open, and my database is apparently simple enough that this still runs quickly.

Out of curiosity, do you have any suggestions for how I could have discovered this information on my own? I always have a lot of trouble using the built-in scripting dictionaries, and I feel that it's mainly because of the lack of examples. In this case, when I went to the OmniFocus dictionary looking for something to help, I found "OmniFocus suite > available task" almost immediately, but I still don't see how I could have known that available tasks are contained in contexts, just from reading the entry for "available task". Is there something obvious that I'm overlooking here?

Thanks again; your responses have already been a big help!