Sorry, wasn't entirely sure where to post because Shortcuts isn't 100% about iOS or a specific device, nor do I consider it programming either (or is that just because I'm so used to thinking that programming can't have a visual interface? I tired to look around and see which forums would have Shortcuts threads, but I didn't notice an obvious place.) Anyway.
As my work computer (classic Mac Pro) won't sync with the new Reminders app anymore but I keep Reminders visible on my iPad as a task list all the time, I had to solve handy on-the-fly Reminder addition by creating an Applescript app, which – through a sequences of dialog boxes – asks me to type in the details of a reminder.
It compiles that information into JSON data, then uses Mail to send that to my iCloud e-mail address with the title "Reminder".
In Shortcuts on my iPad, there's an automation which is set to run "if you get e-mail with the title 'Reminder' from this address".
That automation parses the JSON data, uses that data to create a new reminder.
Upon success, it opens the Reminders list to show you that the new task got added.
Earlier, I had successfully managed to let the Applescript ask me for a reminder a title, priority, notes, and tags.
Now, I wanted to update that version so it would also take (optional) date, and, let me specify which list it should go to.
It sort of works, but I can't figure out an inconsistency in the date handling:
✅ When I do input a date in the Applescript dialog box for the reminder-to-be, the Shortcuts automation on my iPad picks it up and correctly assigns that due date to the reminder that it creates. I don't have to do anything to the iPad, it's all delivered independently as it should.
❌ It doesn't seem to work right when I leave the date field in the Applescript query as empty. When the iPad picks the e-mail, the automation runs and the reminder is added, but then the iPad displays a calendar date picker, asking me to choose a date. If I tap 'cancel' on that, the reminder has still been added without a date (because date is added after reminder creation, via 'edit reminder' block). But it doesn't then proceed to switch the view to that Reminders list, so I assume that 'cancel' on the date picker terminates the whole automation from there on.
➡️ So the issue is, I'd rather not see that date picker, ever. Just use the specified date for the reminder if one was given, but if there was no value, don't ask about dates. It should be simple, right?
In Shortcuts, it starts by doing the JSON parsing from the received e-mail.
Then it creates a new reminder, directly using variables that it got from that JSON data.
Some Reminder data can be inserted directly in the creation block, while some can only be injected afterwards, using the "edit Reminder" blocks.
Date is one of those things that require such post-injection by 'edit Reminder'. So when I want to handle the date, and only edit the reminder date if one was specified, I created an If block for that. I thought the logic would be as simple as this:
And with this, it can successfully add the date if it had a date, but why does it ignore "otherwise do nothing and end if"?
Why display the date chooser if value was empty? It almost feels like it's somehow entering the if block in both cases, i.e interpreting empty as not empty. What am I missing?
Thanks for your time!
As my work computer (classic Mac Pro) won't sync with the new Reminders app anymore but I keep Reminders visible on my iPad as a task list all the time, I had to solve handy on-the-fly Reminder addition by creating an Applescript app, which – through a sequences of dialog boxes – asks me to type in the details of a reminder.
It compiles that information into JSON data, then uses Mail to send that to my iCloud e-mail address with the title "Reminder".
In Shortcuts on my iPad, there's an automation which is set to run "if you get e-mail with the title 'Reminder' from this address".
That automation parses the JSON data, uses that data to create a new reminder.
Upon success, it opens the Reminders list to show you that the new task got added.
Earlier, I had successfully managed to let the Applescript ask me for a reminder a title, priority, notes, and tags.
Now, I wanted to update that version so it would also take (optional) date, and, let me specify which list it should go to.
It sort of works, but I can't figure out an inconsistency in the date handling:
✅ When I do input a date in the Applescript dialog box for the reminder-to-be, the Shortcuts automation on my iPad picks it up and correctly assigns that due date to the reminder that it creates. I don't have to do anything to the iPad, it's all delivered independently as it should.
❌ It doesn't seem to work right when I leave the date field in the Applescript query as empty. When the iPad picks the e-mail, the automation runs and the reminder is added, but then the iPad displays a calendar date picker, asking me to choose a date. If I tap 'cancel' on that, the reminder has still been added without a date (because date is added after reminder creation, via 'edit reminder' block). But it doesn't then proceed to switch the view to that Reminders list, so I assume that 'cancel' on the date picker terminates the whole automation from there on.
➡️ So the issue is, I'd rather not see that date picker, ever. Just use the specified date for the reminder if one was given, but if there was no value, don't ask about dates. It should be simple, right?
In Shortcuts, it starts by doing the JSON parsing from the received e-mail.
Then it creates a new reminder, directly using variables that it got from that JSON data.
Some Reminder data can be inserted directly in the creation block, while some can only be injected afterwards, using the "edit Reminder" blocks.
Date is one of those things that require such post-injection by 'edit Reminder'. So when I want to handle the date, and only edit the reminder date if one was specified, I created an If block for that. I thought the logic would be as simple as this:
Code:
if [that date field in the JSON data] has any value, then
set Deadline of Edited Reminder to [that date field]
otherwise
end if
And with this, it can successfully add the date if it had a date, but why does it ignore "otherwise do nothing and end if"?
Why display the date chooser if value was empty? It almost feels like it's somehow entering the if block in both cases, i.e interpreting empty as not empty. What am I missing?
Thanks for your time!
Last edited: