Hi!
I’ve just started scripting. I use reminders + shortcuts on a lot on my daily routine. At the beginning of the day, I run a shortcut that sets reminders of things I need to do at certain hours, some of them being another shourtcuts. As part of the shortcut triggered by the reminder, I delete the reminder, but due to shortcut limitations, I need to press confirm to delete it.
This is where the following simple script gives my an extra. I have replaced the “delete reminder” blocks of my shortcuts, and using the pasteboard, pass a string to the script. The script then compares it to the existing reminders, complete it and delete it.
It’s a really simple script, but it may help someone.
var reminder = Pasteboard.pasteString();
let all = await Reminder.all();
for (let r of all) {
if (r.title == reminder){
r.isCompleted = true;
r.remove();
}
}
Safari.open("shortcuts://");
This links shows an example of what is to be used in shortcuts: https://www.icloud.com/shortcuts/ea499336cc6340cbb4e5805eea077eb4
Just remember to change the name in the url to match the name of your script.