View Full Version : Applescript example: exporting to a text file
RobTrew
08-21-2007, 01:16 AM
Here is a simple script intended to demonstrate how one can move task by task through the whole Omnifocus database using Applescript.
It simply lists the names of all folders, projects and tasks in a tab-indented text file, and opens the file in the default text editor.
Not exceptionally useful (doesn't list dates etc) but it may serve as reference for anyone writing something more sophisticated.
isidoro.porquicho@gmail.c
09-10-2007, 01:57 AM
thanks in advance
isidoro
PS: will it work if my Mac is used in any non-English language (i.e Spanish)???
RobTrew
09-10-2007, 01:09 PM
Should be no problem.
steve
09-10-2007, 04:22 PM
I've been waiting for something like this! Thanks! I feel more comfortable having a plain text back up.
Steve
Tim Wood
09-10-2007, 08:45 PM
It's worth noting that the OmniFocus file format is simply gzipped XML, so should you need to do something with your data, it's there for easy use.
RobTrew
09-11-2007, 04:46 AM
so should you need to do something with your data, it's there for easy use.
A good point, though "easy" might need to be reformulated.
My understanding is that the XML structure is transactional (recording a series of insertions, deletes etc) rather than structural, and that it would therefore be difficult to write an XSLT transform to generate a simple ordered document out of all the transactions.
Is that correct ?
Tim Wood
09-11-2007, 09:27 PM
My understanding is that the XML structure is transactional (recording a series of insertions, deletes etc) rather than structural, and that it would therefore be difficult to write an XSLT transform to generate a simple ordered document out of all the transactions.
Is that correct ?
This is correct to an extent for the file in ~/Library/Application Support/OmniFocus. This allow us to write small changes rather than writing the entire file (with our changes mirroring the SQL operations that happen in the CoreData database). The backups that OmniFocus writes are fully flattened into a single XML file, however.
vBulletin® v3.7.2, Copyright ©2000-2008, Jelsoft Enterprises Ltd.