I’ve been thinking about organizing and reporting on OmniFocus tasks, and thought I might do some stuff with them in OmniOutliner. Does anyone know an elegant way of exporting from OF to OO?
Through some old forum posts, I have found that if I export a CSV from OF, open it in Excel, export it as a tab-delimited txt I can open it in OO, but something a little smoother or direct would be nice.
If you have OmniFocus Pro, you can use this excellent script by Curt Clifton Export View to OmniOutliner—curtclifton.net
Note that it doesn’t preserve completion status. So if you have completed tasks in your view, they will appear as unchecked in OmniOutliner. I use a modified version that doesn’t have this behaviour.
You’re welcome.
Sure, no problem.
If you don’t have OmniOutliner running, it opens and creates a document with your default template. If you have documents opened, it will append the content to the end of the front document.
Unfortunately, something in the script language (I think relating to identifying whether or not a task is completed) is erroring on me. Any thoughts about how to troubleshoot? Screen:
You’re welcome, @deturbulence.
Sure, I can help.
I think you are trying to run the script with a context based perspective showing in the front document window. It only works with project based perspectives, since contexts don’t have completion status.
You don’t need to select any task. For example, you multi-select 3 projects in the sidebar and they will display. When you run the script, what you see in the front document window is exported (unless it’s a context based perspective).
I’m still erroring, though, referring to not being able to get completion status of a folder (which makes sense, since like a context, a folder cannot be completed), but then errors this way if I move the projects to the root of my tree (i.e. not in a folder):
error "OmniFocus got an error: Can’t get completed of value of tree 1 of content of document window id 4959 of default document." number -1728 from completed of value of tree 1 of content of document window id 4959 of default document
The export isn’t quite as rich as my inelegant method above, though - I was hoping for columns for each of the attributes, things like context, due date, estimated time, etc. in order to manipulate and group and examine the things with summary rows in OO.
I suppose the script could be extended, or maybe there’s an easier way to process the CSV into a tab-delimited text.
Thanks for all your help to make this work, though, @unlocked2412! I really appreciate it.
That’s interesting. In the future, if I have some spare time, I want to do something similar. I think it’s possible. And I will let you know.
You’re welcome, @deturbulence!
P.D.: Just for the record: The script gets the top level trees, and when it tries to get the completed property of tree 1 (top level heading), it shows an error.
I’m glad that you were able to solve it via AppleScript, but I continue to hope that more export features are put into the application. I’ve been asking for this for 10 years!
@unlocked2412, is there a way to make this script create a new document with my default template instead of a new (bare) document? I have this trouble in other scripts too: I cannot apply any themes to them and have to copy and paste into a new OO file with ⌘N .
Ok, so you can try this. If OO is running, it creates a new document with your default template and a new row. If OO isn’t running, it adds a row at the end of the document.
Is this an improvement to your workflow? If the answer is yes, we can add more complexity.
tell application "OmniOutliner"
activate
tell front document
make new row with properties {topic:"Hello World"} at end of every child
end tell
end tell
Thanks for still working with me. With OmniOutliner quit, the script gives me a new file from my default template with a new “Hello World” row.
But with OmniOutliner running and no outlines open, running the script I get the following error: “OmniOutliner got an error: Can’t get document 1. Invalid index.” If I click OO on the Dock I get a new default template without the script.
property the_template_path : ""
set the_template to POSIX file the_template_path
tell application "OmniOutliner"
open the_template
tell front document
delete (every row)
make new row with properties {topic:"Hello World"}
end tell
end tell