Shortcut Automation

I wrote a shortcut that pulls the nasa picture of the day and imports it to a new note. I setup a time based automation to trigger the shortcut once a day, but the automation fails when the device is locked. Is there a way to trigger note creation in the background without launching the app?

I’m not 100, but I have a feeling that this is an iOS limit on x-callback URL use.

I’ve been working around a few of these by playing with timing and triggers, like using my routine Shortcuts to also do some other stuff (because I can count on the device being unlocked and available at that moment), or tying triggers to the opening/closing of apps I know I will use at particular times/frequencies.

Sorry this isn’t super helpful as a solve, but maybe some workaround ideas?

ScottyJ

Drafts has an import action in Shortcuts that can append or create content in the background even if the device is locked. I use this capability to import Covid stats to a static note. It would be nice to streamline auto-import capabilities in Agenda.

1 Like

I think it works because it’s a native Shortcut action, and not using x-callback.

I know what having Shortcut actions in Agenda has been discussed in the past but not sure if it’s being worked at the moment?

Not right now as in right now, but it’s definitely something we’d like to add support for.

3 Likes

Hello everyone, glad I found this discussion! I have been running a daily shortcut automation at 00:01 that looks like this:

agenda://x-callback-url/create-note?title=%5Cdate(yyyy-MM-dd)%20Yuriy%20daily%20journal&project-title=Daily%20Journal&date=today&template-name=daily%20template&on-the-agenda=false&template-input=Note

and it runs well when the screen is unlocked, pulling all my calendar events from the Note variable, which was generously provided by @heyscottyj in his daily log builder shortcut code, which I then tweaked to input into my daily journal template.

However, the automation returns an “Automation Failed. […] The app may not be installed on this device.” notification.

I don’t mind running it manually as long as the x-callback-url is not natively allowed to run, but I was wondering if this is a bug or just the current system limitation. Does anyone else have this issue with automation?

Likely, this is because you’re using Agenda Shortcuts actions. The way Shortcuts are implemented by Agenda at the moment means the actions aren’t unified between macOS and i(Pad)OS. This makes it a bit confusing, because it means that Shortcuts you make on your phone won’t work on the Mac and vice versa.

As a workaround, I’m using the x-callback URL only instead of Agenda actions, as that will work cross-platform.

1 Like

Alternatively, make the Shortcut with actions on the device you will run it on, but know that it will only work on that platform. That should fix you up!

1 Like

Thank you, this is hugely helpful! I will build the shortcut on my iPhone and test the automation again and report the results.

1 Like