Taskpaper to Omnifocus messing with dates and times

I’m using @RosemaryOrchard’s Drafts 5 Taskpaper to Omnifocus scripts and I keep running into the problem that the tasks all default to a due time of 12am on the due date I set. So then I changed it to explicitly include the time, but now it ignores the date calculation. Here’s an example of one line of the project:

Schedule Recording of Let's Talk «SHOWNUMBER» «SHOWDATE» @tags(Slack, calendar, Podcast Recording) @due(«SHOWDATE»-5d 5pm)

When executed, this Omnifocus task has a due date and time of the day before the SHOWDATE at 7pm. It seems Omnifocus is interpreting the “-5d” as -5 hours from 12am on the due date. If the @due is “«SHOWDATE»+3d 5pm”. then it sets the due date to SHOWDATE at 3am. If the @due is “«SHOWDATE»+3d +17h,” it ignores the “+3d”. What am I doing wrong?

By the way, I do have Omnifocus preferences set so that default time for due dates is 5pm.

Have you triesd a space between the showdate and the -5?
It looks like they’renone word in the example, but I’ll try running it tomorrow

1 Like

I suspect this is exactly it, it’s also possible that the 5pm won’t be read, so what you may want to try is:

@due(«SHOWDATE» 5pm -5d)

Remember, OmniFocus can read fuzzy times - but it’s not human. So in general grouping the time and date together, followed by the calculation needed, is what you’ll need.

1 Like

Yep, I tried it with the space and without.

Thank you. I’ll give that a try. I sometimes forget that software has gotten smarter in some ways and is still rigid in others so that things like order of operations, as it were, are still important.

Ithink reversing the days and time like rose said should work

Unfortunately, it did not work. It just ignored the time. It did get the date right though.

Just a thought, but barring a solution to the time problem, is there a way to get Omnifocus to respect the default due time of 5pm when importing a Taskpaper project?

Have you checked what the TaskPaper is before it is pasted? It may well be a rogue time is being attached to the date somewhere.

Do you mean check the output of the script before it pastes to Omnifocus?

Yes, my TaskPaper action Group has the ability to create the TaskPaper after adding it to OmniFocus, you check what it actually pasted that way :slight_smile:

So it’s not the scripts. It’s something to do with how Omnifocus is importing the Taskpaper format. If I take the first three lines:

- Record Let's Talk 36 2/2/19 @autodone(true) @due(2/2/19 +3d 5pm)
- Ask for Panelists for Let's Talk 36 2/2/19 @tags(Slack) @due(2/2/19 5pm -5d)
- Add Panelist names to AirTable record for LTK 2/2/19 @tags(AirTable, Podcast Recording) @due(2/2/19 -4d 5pm)
- Schedule Recording of Let's Talk 36 2/2/19 @tags(Slack, calendar, Podcast Recording) @due(2/2/19-5d 5pm)

and paste them into Omnifocus (no scripts), I get:

  • The project (first line) due on 2/2/19 at 3am
  • Ask for panelists due on 1/28/19 at 12:00am
  • Add panelist names due on 2/1/19 at 8pm
  • Schedule recording due on 2/1/19 at 7pm

(You’ll notice I tried different combinations of order and spacing to see if any of those fixed it.) This is weird, isn’t it? Is it just me?

Maybe I should be trying to do the math in the script, not in the import to Omnifocus.

Not just you, I’m getting the same results.

Possibly worth contacting the Omni gang? Perhaps it’s a known bug?

There is this: https://mobile.twitter.com/kcase/status/963076954374119424?lang=es

I definitely think the adjustments need to come after the date and time:

- Record Let's Talk 36 2/2/19 @autodone(true) @due(2/2/19 5pm +3d )

If it still doesn’t import correctly then send an email to omnifocus@omnigroup.com with some examples to get some more help debugging though, the support staff are lovely and very helpful!

1 Like

Thank you for all your help, Rose. I do think this is an Omnifocus support issue, not a scripting problem.

Interesting, but I think it’s for setting the default time in iOS. The macOS app does have a setting for that in preferences, but Taskpaper import isn’t respecting it.

Ah, yes, living mostly Mac-less at the moment and forget that others are not necessarily!

1 Like

As a followup, I found one of Clifton’s scripts to do the job for me on my Mac. While it doesn’t have all the date math I could do with Rosemary’s scripts, since I’m mostly on my Mac anyway, this is a convenient solution for me. Hopefully, Omni Group will get back to me eventually (I’ve been waiting more than a week with no response) and they’ll tell me whether the problem I was having was an OF bug or not.