I am trying to develop a shortcut that sends a random message to someone daily. I have figured out the part to pick a random item from a list, but have not been able to figure out how to make it run at a random time daily
Automation offers specific times and events only currently.
You could use an external service to generate randomly timed notifications that you could use a URL in to prompt to run a shortcut.
You could also use a local reminder or calendar event to do something similar, but use a Shortcuts to generate the reminders / events. One way to apply the random time would be to take a base time and add a random number of minutes to it. For example 00:00 + 0 to 1339 minutes.
If you were not tied to Shortcuts, and depending upon what channel you want to message someone via (I’m assuming so far by message it is via the Messages app), there may be other options that could be viable.
I used Scriptable and Shortcuts to set up a random timing thing once! It was too long ago to recall the details but Scriptable can essentially create notifications with Shortcut actions. You’ll still need to tap the shortcut though.
Keyboard Maestro on the Mac would also handle this easily.
A Shortcuts-only option would be to generate random numbers to create a random time between some basic parameters, and then use the very versatile Shortcuts action Get Dates From Text — if you don’t specify a date, but just a time in the text, it will assume you mean today.
So if you want it sent between 10 am and 11 am, pick a random number between 0 and 59, and use that to create a string like
10:xx a.m.; put that in a text field, and pass it to the Get Dates From Text action. (You could also generate the hour and pick AM/PM randomly too.)
I’m not sure how to have Shortcuts send a message at a particular time, but it sounds like you might have figured that out already.