How to generate a "daily" actionable local notification to run a shortcut/script?


#1

I want to create an actionable local notification that runs once every workday; the action should run a shortcut/script.

How can I do this?

Does Shortcuts support this?

I think it should be possible in Scriptable using its Notification support, by scheduling five (Mo/Tu/We/Th/Fr) weekly notifications. Unfortunately the documentation is not very clear: weekday refers to “a specific day of the week”, but how does the counting work? When does the week start? (Mo/Su/…) And where does the numbering start? (0/1)

@simonbs Can you please explain? (And perhaps improve the documentation?)


#2

One option would be to use Launch Center Pro to run a shortcut. You can set up the notification for each weekday (even in the old version). When it appears you can simply tap on it to run the shortcut.


#3

Yes, that works! (I did not even know that this was possible)

However, I seem to easily miss the LCP notifications…


#4

Launch Center Pro is ideal; the latest version having more versatile scheduling options. The script would need to be triggered by a URL scheme call as you might expect.

Scriptable notifications would absolutely enable this. The days of the week I believe are the standard JavaScript ones used in getDay(), etc. I believe (Sunday = 0).

Due can also be used to produce scheduled actionable notifications in a similar way to LCP, and might be an alternative for you if you don’t have LCP.

Shortcuts doesn’t exactly have the scheduling built in, but you can view a shortcut and then Ask Siri to schedule a reminder which when the notification appears should be actionable.

Example:

Hope that helps.


#5

I do have LCP and it does the job indeed.

PS: the script is a Pythonista script, so I don’t even need Shortcuts in this use case :slight_smile:


#6

I only included Shortcuts in my response as you explicitly asked about it :wink:


#7

Yes, definitely my fault.

Somehow I focused too much on Shortcuts being required…

In fact: Pythonista itself has native Notifcation support

(I will try this later)


#8

Pythonista turns out to be perfect for this:

I can schedule (repeating) actionable (local) notifications and the notification actions will run in the background.


#9

+1 for Launch Center Pro. I had one for a while but I could never really figure out what I wanted to put in a daily notification.


#10

@sylumer I do have both, but I never knew you could trigger actions with Due! How is this done?


#11

Have a read through this post. There’s discussion about it in regards to what the OP wanted to do.


#12

Thank you! It’s a bit convoluted, but good to know it’s possible nonetheless :slight_smile: