PDA

View Full Version : Omnifocus to Omnioutliner (including columns)


RobTrew
2007-12-18, 03:25 PM
I have drafted an applescript which I am using to export Omnifocus projects and tasks to Omnioutliner Professional, including the Context, Start Date, Due Date, Completion Date, Duration and Flagged columns.

No guarantees that it will work on your system, but it may be a useful reference, and you should be able to extend it to include any other columns that you may need.

Rob

Download page (http://web.mac.com/robinfrancistrew/Site/OF2OO.html)

librarymonkey27
2007-12-18, 05:08 PM
Seems to work for me

leopard 1.5.1
intel iMac

thank you

and not to look a gift horse in the teeth, but it does not send the formating with it...but it does get there

Craig
2007-12-18, 05:43 PM
No luck for me. I get "NSReceiverEvaluationScriptError: 3" with the first instance of "project" highlighted when run from Script Editor.

Tiger on PPC.

RobTrew
2007-12-18, 11:12 PM
Haven't yet found a way of reproducing that error with Leopard 10.5.1 and Omnifocus 96221, but it might be worth trying to run the script from the Omnifocus toolbar:

1. Copy the script to ~\Library\Scripts\Omnifocus
2. In Omnifocus choose View\Customize Toolbar, and drag the script onto the toolbar.

(It can be helpful before stage 1, to select the script, choose "Get Info" from the Ctrl-Click menu, select the icon at top left, and then paste an alternative graphic to serve as an icon for the script).

(The script seems, incidentally, to run faster from the the Omnifocus toolbar than when launched from Script Editor).

Note that I have now posted a new version (http://web.mac.com/robinfrancistrew/Site/OF2OO.html) which is intended to export only whatever is displayed and selected in the right-hand content panel.

RobTrew
2007-12-19, 01:47 AM
not to look a gift horse in the teeth, but it does not send the formatting with it

Exporting the formatting is probably not an option for the moment - as far as I can see Applescript only has access to the raw text in Omnifocus.

A set of Omnioutliner styles might be your best bet.

Craig
2007-12-19, 04:58 AM
it might be worth trying to run the script from the Omnifocus toolbar:

1. Copy the script to ~\Library\Scripts\Omnifocus
2. In Omnifocus choose View\Customize Toolbar, and drag the script onto the toolbar.

Nope, same error that way.

(Note that I'm posting this for the sake of anyone else trying to troubleshoot the script - I'm not expecting technical support from you! :) )

RobTrew
2007-12-19, 05:41 AM
Nope, same error that way.

Would be interested to know whether this is occurring with the new version (http://web.mac.com/robinfrancistrew/Site/OF2OO.html) (which exports from selections in the right-hand content panel), and if so, on which line of code. (Also whether you are using OO Pro or plain OO - it is written for the former)

Craig
2007-12-19, 06:09 AM
Yes, new version. Yes, OO Pro. Looked like the same error as before, so I assume the same location in the script I mentioned - the "project" in quotation marks after the doesn't-equal sign. (I've since deleted the script so can't confirm at the moment.)

RobTrew
2007-12-19, 06:40 AM
I assume the same location in the script I mentioned - the "project" in quotation marks after the doesn't-equal sign

You mean

set blnContext to (selected view mode identifier ≠ "project") ?

That seems surprising, at first glance ...

Ken Case
2007-12-19, 06:50 AM
You mean

set blnContext to (selected view mode identifier ≠ "project") ?

That seems surprising, at first glance ...

Oh, I've seen that problem: Tiger doesn't like the way Leopard encodes the ≠ character; I think Leopard uses Unicode and Tiger expects MacRoman or something along those lines.

The simple fix is to replace "≠" with "is not equal to".

Craig
2007-12-19, 07:16 AM
The simple fix is to replace "≠" with "is not equal to".

Well, having done that, now I get "NSReceiverEvaluationScriptError: 3" with "selected trees" highlighted.

RobTrew
2007-12-19, 08:07 AM
The simple fix is to replace "≠" with "is not equal to".

Thank you !

I have uploaded an amended version (http://web.mac.com/robinfrancistrew/Site/OF2OO.html).

It seems, however, to judge by Craig's experience, that Leopard-baked Applescripts may have other problems on Tiger machines. I wonder if Apple is aware of this ?

I have uploaded a plain text (MacRoman) copy (http://web.mac.com/robinfrancistrew/Site/OF2OO.html), and I have now downloaded and run it successfully on a Tiger machine with a simple set of data in Omnifocus.

Robin.

Craig
2007-12-21, 06:06 PM
Here's what I'm seeing with the latest (text) version.

RobTrew
2007-12-22, 05:11 AM
Here's what I'm seeing with the latest (text) version.

Looks reminiscent of a problem discussed in another thread (http://forums.omnigroup.com/showthread.php?t=6159&highlight=trees+content)

What are your OS and OF versions ? Do you have multiple OF windows open ?

Craig
2007-12-22, 06:01 AM
Looks reminiscent of a problem discussed in another thread (http://forums.omnigroup.com/showthread.php?t=6159&highlight=trees+content)

What are your OS and OF versions ? Do you have multiple OF windows open ?

YES! version 9 works for me! :) :D :cool:

Thanks Robin!

Tate
2008-01-07, 12:57 PM
Is this script still available? (getting a message from .mac that page can not be found.)

Craig
2008-01-07, 01:21 PM
Is this script still available? (getting a message from .mac that page can not be found.)

I think the author rearranged his pages a bit some some old links don't work. Try this:
http://web.mac.com/robinfrancistrew/Site/OF2Omnioutliner.html

Tate
2008-01-08, 05:44 AM
Thanks! I'm seeing that now.

RobTrew
2008-01-08, 06:38 AM
Thanks Craig. Both links should now work.

James Carl
2008-02-01, 11:17 PM
I just got done moving a ton of my Omnioutliner files into Omnifocus and I was busy arranging them when I tried to move some items back out to OmniOutliner Pro. They appear as links and they loose their hierarchy. I have been searching high and low and I found this thread.
I put the script into a new folder I labeled "Omnifocus" into the base level Library\Scripts folder but I don't understand how to drag the script onto the toolbar?

I am completely shocked that being able to export an outline to OO isn't a feature built right into Onmifocus.

RobTrew
2008-02-02, 03:56 AM
I put the script into a new folder I labeled "Omnifocus" into the base level Library\Scripts folder but I don't understand how to drag the script onto the toolbar

It sounds as if you may be looking at the top level /Library/Scripts/. What you actually need is the Library folder of your user account.

/Users/[username]/Library/Scripts/Applications/Omnifocus

Once you have placed the script there, it will show up in Omnifocus when you choose View/Customize_Toolbar from the main menu.

SAllen
2008-02-20, 12:03 PM
I'm new to Apple Scripting - the script you have enclosed works great. I would like to add the attachments to the OmniOutliner File.

Is this possible - just change say the Flagged column to Attachments?

Thanks a Lot

RobTrew
2008-02-20, 12:17 PM
"just" is always a tricky word :-)


Derek M's post (http://forums.omnigroup.com/showpost.php?p=32653&postcount=2) seems to confirm my impression that it is not possible, at the moment, to place attachments in Omnioutliner using Applescript.

librarymonkey27
2008-04-06, 08:13 AM
I've added a column... "Context" to my Omni-Outliner... I am using OO 3.65 does the export of context only work with OO Pro?

RobTrew
2008-04-07, 09:23 AM
The script described in this thread exports from OF to OO (and includes export of OF contexts).

Are you talking about moving in the opposite direction ?

librarymonkey27
2008-04-07, 08:45 PM
yes, I was...got a bit mixed up

Lucas
2009-01-06, 05:11 PM
This script is great! Thanks! I also found that just cutting "Professional" out everywhere seems to allow it to work with regular OmniOutliner just fine.

joshfree
2009-10-13, 03:15 PM
Rob, if you're still monitoring this thread (or if anyone else knows what's up with Applescripts) I have two questions:

1. How do I get a script to appear as an icon in the tool bar of OF?

2. When I tried running OF2OO-09, I ended up with duplicates of every item selected in OF -- I had a properly nested set, then additional copies of every single task, un-nested, as well. Any way to stop that behavior? I'm using OF 1.7.4 and OO 3.6.3 (not OO Pro).

Thanks!

curt.clifton
2009-10-13, 04:27 PM
1. How do I get a script to appear as an icon in the tool bar of OF?


See this thread (http://forums.omnigroup.com/showthread.php?t=7453&highlight=script+toolbar). You may need to restart OF after putting the script in the right folder before it is available to add to the toolbar.

See also this thread on customizing the actual icon (http://forums.omnigroup.com/showthread.php?t=13253&highlight=script+icon).

RobTrew
2009-10-14, 02:20 AM
When I tried running OF2OO-09, I ended up with duplicates of every item selected in OF -- I had a properly nested set, then additional copies of every single task, un-nested, as well. Any way to stop that behavior?

It sounds like you are selecting both projects and their children.

(The children of any selected project are automatically exported)

The trick is to select just projects (Cmd Click on each project required)

(or select just a few children if you want them without the parent project name)

joshfree
2010-01-02, 01:45 PM
Thanks so much for clarifying that! (Sorry to take so long to respond.) Just collapsing all the rows, then selecting them using Command-A works perfectly.

vincentkeunen
2011-12-26, 02:41 AM
I am completely shocked that being able to export an outline to OO isn't a feature built right into Onmifocus.

I'm also pretty shocked: I bought OF for iPhone, then for Mac, then for iPad, then OO for iPad... Costs are going up! Then I needed to do mass work on OF items like collecting them, reorganizing them and working on a draft document, so I wanted to move all those items to OO. Not easy on an iPad nor iPhone... So I decided to go for OO on Mac and I paid an extra 39$... Just to discover that it does not easily import OF files, nor any exportable file by OF!

*Very* frustrating... I feel my data is trapped. Please don't become a new Microsoft... Omni group, can you do something? Simply exporting a number of tasks from OF to OO. Can't be that hard!? Did I miss something?

Please help!

vincentkeunen
2011-12-26, 03:06 AM
I read the whole thread and it does not work for me (OF 1.9.4, OO 3.10.3, OSX 10.7.2, OF2OO script: Illustrative draft Ver 0.5).

I select a project (named MIMS) in OF then click on the right, select all and click on the icon of the script (see illustration at https://skitch.com/e-vincentkeunen/gwnbc/projects-mims). OO is launched but nothing appears in it. Just a blank outline. I just bought OO just for that... :-/

Did I miss something? Can someone help?

https://skitch.com/e-vincentkeunen/gwnbc/projects-mims

Thanks

PS1: I replaced "OmniOutliner Professional" by "OmniOutliner" in the script (seems to work since OO is launched)
PS2: IMG tags in this forum don't seem to work (there is one above the word "Thanks")

whpalmer4
2011-12-26, 10:42 AM
It's pretty rare, in my experience, that one of Rob's scripts doesn't work when correctly installed and invoked, unless I'm the one doing it :-)

I made a sample project:

http://img856.imageshack.us/img856/4882/screenshot20111226at110.png (http://imageshack.us/photo/my-images/856/screenshot20111226at110.png/)


I modified the script to invoke OmniOutliner instead of OO Pro, saved it (as type Script), and added the script to my OF toolbar.

http://img851.imageshack.us/img851/2536/screenshot20111226at111.png (http://imageshack.us/photo/my-images/851/screenshot20111226at111.png/)

I then selected the project by clicking on the top row on the right hand side of the OmniFocus window.

http://img848.imageshack.us/img848/4882/screenshot20111226at110.png (http://imageshack.us/photo/my-images/848/screenshot20111226at110.png/)

Finally, I invoked the OF2OO script by clicking its toolbar button, and got this in OmniOutliner:

http://img694.imageshack.us/img694/4882/screenshot20111226at110.png (http://imageshack.us/photo/my-images/694/screenshot20111226at110.png/)

I opened the note on that first action so you could see that the note field came across as well.

Now, both Rob and I use Snow Leopard, and there is a possibility that this is something that is a Lion-only bug. If I encounter a Lion machine where I can install OmniFocus, I'll try it out and report back.

By the way, those images come to you via IMG tags. Something like this should work (replace "I MG" with "IMG", I needed to keep the forum software from thinking I had too many images in the post):

[I MG]http://img694.imageshack.us/img694/4882/screenshot20111226at110.png[/I MG]


As for your data being trapped, it's all there in an easily readable XML format, with no attempt made to lock you in. OmniFocus has essentially the same outlining operations available as OmniOutliner, so if the ultimate destination is OmniFocus, I'd skip the trip to OmniOutliner. Otherwise, in my experience Rob's script works well to go to OmniOutliner, and he has variants for some other apps as well. It should be possible to modify his script to emit documents for just about any scriptable app that allows creation of rows via the scripting interface. If you aren't happy with your OO purchase, contact sales@omnigroup.com within 30 days of purchase for a full refund.

vincentkeunen
2011-12-28, 12:22 PM
Thanks for your quick reply!

1/ do you use all the same versions as I use ? (except Lion)
2/ I retried today and got no luck - and no error !?
3/ about the IMG tag: I used the "Insert image" button in the edit box and this button added the IMG tags. I checked (by doing an Edit of my message) to verify and it does contain IMG, not I MG tags... So I suppose they are right but they don't show correctly !?
4/ thank you for offering to refund - since you have a great support and I still hope to manage that transfer, I won't ask the be reimbursed for the moment! :-)

Note: when I launch OF, select the project then click the script, OO does launch but without importing the data. However, when I then quit OO and retry clicking the script, nothing happens (OO does not get launched again). I need to quit OF and relaunch it so that when I click on the script, OO is launched... Maybe a related problem? Scripting on Lion has maybe changed more than we think?

vincentkeunen
2011-12-28, 12:36 PM
Another wierd thing that might help debug:

I noticed the icon "OFQuickStats" in your screenshots. So I installed it. I also tried to invoke the scripts from the script menu instead of from the toolbar (in case this could be the problem).

See https://skitch.com/e-vincentkeunen/gwu8q/systemuiserver
https://skitch.com/e-vincentkeunen/gwu8q/systemuiserver

When, in the script menu, I select OFQuickStats, I get the stats correctly.
See https://skitch.com/e-vincentkeunen/gwu89/omnifocus-quick-stats-ver-2.03
https://skitch.com/e-vincentkeunen/gwu89/omnifocus-quick-stats-ver-2.03

BUT when I click "OF2OO" (while selecting the MIMS project), then the AppleScript editor opens to the OF2OO script, instead of executing it!? Is that an hint?

whpalmer4
2011-12-28, 01:16 PM
BUT when I click "OF2OO" (while selecting the MIMS project), then the AppleScript editor opens to the OF2OO script, instead of executing it!? Is that an hint?
Probably. I did include a screenshot showing the settings you need when saving the script so that it will be executable. Have a look at it and try again with those settings, assuming they look the same in Lion.

You could simply run the script from the Script Editor to establish that the functionality isn't broken in Lion and worry about how t invoke it conveniently as a separate matter.

Finlay Boo
2012-03-17, 02:47 AM
Hi,

Has anyone tried working with this script to output a perspective to OO?

My use-case is that I have a perpective that shows which actions I have either delegated to team-mates or need to speak to them about. (Jim or @Jim)

As part of my weekly progress, I like to send a listing out of what everyone is doing or will be doing in.

I have found the current set of printing or export capabilities inadequate but if I could export a context focussed perspective (containing project, context & action start/ end dates information) to OO, then I could work with that.

RobTrew
2012-03-17, 10:41 PM
As part of my weekly progress, I like to send a listing out of what everyone is doing or will be doing in.

You can generate a custom (text) report with something like OF-AQL (http://bit.ly/OF-AQL).

RobTrew
2012-03-18, 10:16 AM
Assuming that OF-AQL.scpt has been copied to ~/Library/Scripts/Applications/Omnifocus/OF-AQL.scpt

You could then generate an email with a script like:
property pstrTitle : "Active Projects"
property pstrQuery : "select folder, name, due date from projects where completed is false and status=active"
property pstrPath : "~/Library/Scripts/Applications/Omnifocus/OF-AQL.scpt"

on run
set strReport to do shell script "osascript " & pstrPath & space & quoted form of pstrQuery & space & quoted form of pstrTitle
tell application id "com.apple.mail"
set oMsg to make new outgoing message with properties {subject:pstrTitle & space & (current date), content:strReport, visible:true}
activate
end tell
end run

Finlay Boo
2012-03-19, 09:03 AM
Thanks for that Rob. I tend to send the listings out in a single report so that everyone gets an idea as to what's going on as well as in their own projects.

Within OF-AQL, I've set the delimiter to a pipe character, played with the format for dates and ensured that the first, element of a line is surrounded by '**' and now I think I've got it pretty much to how I want it.

Turned into an Alfred extension, I now get a report of my active projects, weekly completed actions and now active, scheduled and agenda items for all team members in a lovely Markdown file with a couple of keystrokes.

Having said that, I like the mail option you just posted for quick updates. I must say that I find your OF-AQL and WhereInOF scripts much more useful than the default search, even without the added scriptability.

RobTrew
2012-03-19, 09:55 AM
Turned into an Alfred extension, I now get a report of my active projects, weekly completed actions and now active, scheduled and agenda items for all team members in a lovely Markdown file with a couple of keystrokes.

Sounds good ...

(and a reminder of how useful Markdown can be)

PatrickH
2012-10-08, 05:11 AM
Is this script still available? The links I found in the thread did not work.

RobTrew
2012-10-08, 05:24 AM
Yes, Apple decommissioned all of the old MobileMe links.

You should now find it here (http://www.complexpoint.macmate.me/Site/OF2Omnioutliner.html).

PatrickH
2012-10-08, 05:32 AM
Thanks Rob!

eronel
2013-12-23, 05:30 AM
I find myself in need of a way to export to OmniOutlinerPro and this script looks like the bomb. Any update to where this script is located?

cents
2014-02-15, 11:44 AM
I have an old copy of the script's source, but since the release of OmniOutliner 4, it's no longer working.

Unfortunately, I am not into AppleScript and I'm unable to fix the now broken script. I tried to replace every instance of

application "OmniOutliner Professional"

with

application id "com.omnigroup.OmniOutliner4"

(I saw that in http://forums.omnigroup.com/showpost.php?p=129355&postcount=5). But: no luck. :-(
I had selected some rows in my overcrowded OF inbox, run the script, OO4 opens a new window, but then nothing happens.

Has anybody already adapted OF2OO for the new OO4 world?

Thanks!

popcornflix
2014-03-11, 12:32 PM
This is another excellent reason to keep a copy of OO3 around. OO4 won't open old MORE3 files, either.

Ken Case
2014-03-12, 06:20 AM
I have an old copy of the script's source, but since the release of OmniOutliner 4, it's no longer working.

[...]

Has anybody already adapted OF2OO for the new OO4 world?

There's an updated script over in the Reusable approach to exporting from OF (http://forums.omnigroup.com/showpost.php?p=129131&postcount=12) thread. It works with OmniOutliner 4, and is more flexible in that it lets you copy from Project or Context view.

If you have any trouble with it, let us know!

(By the way, OmniOutliner 4 has added support for scripting attachments, so it should now be possible to copy those as well—but I don't think anyone has updated the script to do that yet.)