View Single Post
Quote:
Originally Posted by psidnell View Post
Thanks, I didn't think of that :-)

I suppose I could write a script that mounted the WebDAV sync directory, unzip the whole damn lot and grep/sed though it all to build a single reference text file of all the context names and ids every couple of weeks - my top level contexts are pretty stable.

I had tried mailing a task out of OF and sniffing though the attachment to see if there was anything useful hidden in it, but no.

It does seems like using a dinosaur killing asteroid to crack a nut though, makes waiting until I get home and fixing it on the mac seem quite appealing, but where's the challenge in that :-)
Hey, if you're going to write that script, it might as well run every time the database changes, and mail you a neat list of new project and context ids in URL form for your pasting pleasure!

It might be easier, though, to use AppleScript, where you could just take the flattened lists of contexts and projects and spit out the ids, rather than trying to do it with anything where you need to parse the files yourself. Someone has already written that code, might as well take advantage of their work!

A bit of code:
Quote:
tell application "OmniFocus"
tell default document
set AllContexts to flattened contexts
set lastContext to last item of AllContexts
set AllProjects to flattened projects
set lastProject to last item of AllProjects
display alert "Last created context: " & return & " " & name of lastContext & return & ¬
" with id: " & id of lastContext & return & ¬
"Last created project:" & return & " " & name of lastProject & return & ¬
" with id: " & id of lastProject
end tell
end tell