How to set a relative due date?

I have two separate but related questions regarding the (date) format used in applescript especially the one that sets due dates in reminder.

The line in question is this:

...make new reminder with properties {schedule:once, due date:(current date)}

1. Date format for (current date)

Let’s say I want to make a new reminder with a specific due date in mind, say 1 Jul 2022. I’ve tried a variety of combination but they ended with “AppleEvent handler failed.” What is the accepted format?

2. Set relative reminder at a specific time

If I want to create a reminder with due date “tomorrow 8am” in applescript.

My current script does this:

set tomDate to ((current date) + 60 * 60 * 24)  

…bunch of other stuff

tell myRecord to make new reminder with properties {schedule:once, due date:tomDate}  

Which creates a reminder exactly 24 hours from now. So I only got the “tomorrow” right. What should I be doing so that I can set the relative date (tomorrow), at a specific time (8am)?

Pushed for time here; re. your second question, here is an explainer which should point you in the right direction.

Re your first question, I suspect you need to change your variable to a date, so something along the lines of

set theDate to "01.07.2022"
set theDate to date theDate

It is possible that that code will only work in an external script rather than a script embedded in a smart rule.

set tomDate to (current date) + 1 * days
set time of tomDate to 8 * 60 * 60

Thanks for pointing me to that resource! Seemed that I was overthinking it and the variable is much more straightforward.

It’s simpler than I thought. Thanks!