OmniFocus 3 on iOS due date of subtask before due date of project

Greetings, I am making a Siri Shortcut for a OF template when I am taking a trip. This is based off a shortcut that Rosemary Orchard made for scheduling a trip using Taskpaper in Drafts.

I am trying to schedule a due date of a subtask to be due before the trip. In Shortcuts I am useing the @due(“departure date” -2d) but it keeps setting the due date of as the departure date. I’ve also tried the “@defer” command.

Am I able to schedule a due date before the departure date?

Thanks for any help!

Yes, you can. There seems to be a bug with some date formatting though so try a different format :slight_smile:

Hi Rosemary, thanks for your time. I didn’t know there were different formats, is there one you might suggest?

Thanks

As it doesn’t matter to you I would suggest medium or long :slight_smile:

Sorry Rosemary, I don’t understand, I’m new to all this. I’m not sure I understand medium or long. Would I be using @due(“departure date” -2days) ? Don’t know if that’s what you mean by long.

Like this:

So this will affect the Taskpaper formatting in Drafts and allow me to schedule my packing subtask 2 days before the departure date?

Sorry, I’m not good at automation.

Here’s what I have in Shortcuts to send to Drafts

You don’t need to send to Drafts, just use the “add TaskPaper to OmniFocus” action :slight_smile:

1 Like

further down the workflow I have the “Add TaskPaper to OmniFocus” action but I can’t get the format correct to change the due date. Every month I have to go to the National Guard. So with the way the shortcut currently works is it creates all the tasks that I need to accomplish. One of them is to pack. What I would like is to have the due date for packing to be 2 days prior to my departure date. I am using the terminology in the screenshot that I included in my previous message but OmniFocus is setting the due date to the same date as the departure date. So my question is is there something that I am missing in the format of the screenshot above to change the due date of “Pack” to something other than the departure date?

This is all based on a workflow you created that can be found here: https://www.rosemaryorchard.com/blog/omnifocus-travel-plans

You need to do the calculation for the packing date in the Shortcut itself, not the TaskPaper bit.

Try this:

and then use the packingDate variable in your TaskPaper section.

You can change the time you want the task to be due at in the Format box (set to 09:00 in my screenshot).

Hope this helps.

Thank you for your help, Rosemary. Your efforts are greatly appreciated!

This is exactly what I needed, Tony, thank you so much. I never would have been able to figure this out. This is such a great community for someone just learning automation like myself.

Help from people like yourself and Rosemary Orchard is inspiring!

1 Like

Technically this shouldn’t be necessary, OmniFocus can parse -2d after a date and calculate it itself. There’s a bug in the importer though I think - if I knew what date format were here I could track it down and email it in.

1 Like

Agreed! I’ve tried playing around with TaskPaper in Drafts5 as well and never managed to get the times to calculate properly when running the TaskPaper import. The days manipulation (-2d or whatever) seemed to work, but not trying to set a time alongside the date. In the end I moved to Shortcuts and just did the maths before building the TaskPaper string. I wasn’t sure if it was me misinterpreting how to format the calculations, but hopefully it will get sorted in the not too distant future…

I experienced the same problem with date calculation. I worked with OF Support and we stumbled on the fact that inserting the Format Date action after getting the date input made things work. I use the Short option in Format Date, although I’m not sure that is the only thing that will work. Getting back to the original question, the following should work:

Ask for Input (Input type Date)
Format Date (Short, None)
Set Variable

The last action is probably not required, but I use it because I can keep track of the logic easier.

You can also just use the date variable (either from a date action or from an ask for input action) and format it however you want it as illustrated above: