Very slow when run through Shortcuts. Why?

I am seeing a significant difference in the time it takes for Scriptable to complete execution within the app vs being called from Shortcuts.

This script, executed from Scriptable, is pretty much instant… maybe 1/2 a second before the Reminders list shows up:

    var ProjectList = "abc"
    Calendar.findOrCreateForReminders(ProjectList)

This script is called from Shortcuts and it takes about 6 to 8 seconds to complete:
var ProjectList = args.shortcutParameter
Calendar.findOrCreateForReminders(ProjectList)

Should it take that long?

I’ve noticed this also but I generally find anything with Reminders in Shortcuts takes that length of time (even native actions).

This is my first attempt with Scriptable (the ability to create Reminders lists having just been added).

I have several shortcuts that work with Reminders. One calls four different apps before creating a list and populating it. This convoluted one is faster than the straight shot, one step, Scriptable Shortcut.

Something doesn’t seem right.

I suspect Scriptable isn’t being allocated as much memory when it’s run through Shortcuts vs when you run it directly.

1 Like

Please try to add Script.complete() at the end of the script. I suspect that will make a big difference :blush:

Scriptable attempts to determine when execution of a script have finished. For various reasons, this is more difficult when running with Siri and in the Shortcuts app. Therefore you can use Script.complete() to explicitly tell Scriptable that the script have finished.

There’s a little more detail in the documentation:
https://docs.scriptable.app/script/#complete

4 Likes

That did it. Thank you.

It did feel like Scriptable didn’t know to finish but I didn’t notice anything in the example scripts I checked.

1 Like