OF and Taskpaper still can't agree on default due times

There is a thread that gets at this on Automators from a while back. Taskpaper to Omnifocus messing with dates and times - iOS - Automators Talk

It also is similar to several other posts ('14, '22, on the right side of the screen as I type this). But looking into those reveals the same problems, but no solutions. I see lots of people trying to explain the problem is not with the dates, but the times.

The issue:
When sending Taskpaper tasks to Omnifocus, it will ignore the default due time in OF (set for 2 PM in OF) and instead default all imported Taskpaper due times as 12:00 AM.

I used to use the Drafts function (Rosemary and a few others have made some really great Drafts Taskpaper to OF). Over the past 2 years I stopped using Drafts. I simply don’t need it other than for templates in OF.

I’ve switched to Apple Shortcuts and there is the same problem. Even though I have OF settings to default due times to 2 PM, it will still import this
- Pet the cats @due(today)
in to this:
- Pet the cats (today’s date) 12:00 AM

I can fix this by adding a time after the date, like this:
- Pet the cats @due(today 2pm)

and it will import into OF as:

  • Pet the cats (today’s date) 2:00 PM

27 projects, 405 tasks, aren’t that much to go through one by one and turn off the annoying midnight alert, but I’ve been scouring for an Omni Automation or some other easier method of changing my due times from midnight to at least noon. I might have missed it on the automation site. It is driving me slightly crazy, however.

OK. Tell me exactly what you are looking for and how it should behave.

Just selected actions or all actions with a certain due time should get modified?
You want to run it via Apple Shortcuts or as a plugin? (At the end there‘ll be certainly some custom JavaScript code.)

This should be possible.

I don’t know how to explain it differently. I will attempt to show screenshots of what is happening.

Here are the settings in OF.

Here is a simple task in Shortcuts
Screenshot 2024-02-14 at 1.59.06 PM

Here is how OF handles that TaskPaper exported from Shortcuts into OF and ignores the default due time and changes it to the (annoying) 12:00AM time

This is fixed on one side by adding the time in the Taskpaper itself.
Screenshot 2024-02-14 at 2.02.59 PM

It appears that when OF brings in Taskpaper tasks, if there are no times specifically named in the DUE, it will default to 12:00AM instead of what is in the settings. I’ve had the same time settings in OF for years and it hasn’t worked whether I’m using Drafts, Shortcuts, or some other Taskpaper system.

Oh, dear, my apologies! This was an oversight on my part when building the TaskPaper importer, and though one of our internal testers noticed and filed a bug in our system about it way back in 2016 (eight years ago!), I hadn’t seen it until specifically searching for this bug just now.

I need to dig back into that code to refresh my memory of how it works, but I’m hopeful this will be an easy fix. Sorry for the long delay!

@eddiecoyote
Thank you for explaining the issue. In my understanding there are 3 solutions to this:

First (and the best one) @kcase fixes the issue in OF4 and you are good.

Second, you modify the Apple Shortcut that creates the TaskPaper strings to use today‘s date instead of „today“. I could help you with that if I‘d get the Apple Shortcut.

Third, you use the following workaround till you get a final solution (the first one) from Ken. It checks all OF4 actions for due dates with a time of 12 AM and modifies their due time to 2 PM and then outputs the amount of actions modified. I‘ve not taken into account any projects with due times of 12 AM. If you need them fixed as well, you have to tell me:

DueTime2PM.omnifocusjs (1.3 KB)

Best wishes from Germany

1 Like

Many thanks! This is very helpful. And so easy, that even as a non-Java script programmer, I could easily adapt it to my preferred default time of 5 pm.
Here’s wishing @kcase finds time to fix the bug in the importer, but until then, you’ve provided us with a viable fix - many thanks!

1 Like