I’m trying to call a Shortcut, get the result, find a string in the Draft, replace the string with the Shortcuts result.
I’m using the Run Shortcut step to call the Shortcut, then I want to use the Shortcut output in the script, but I’m not sure what the syntax is for calling the Shortcut result. Using the Template Tag double-brackets simply results in a verbatim replacement, of [[shortcut_result]] for $StartEndTime, while omitting the quotes results in an error.
I’m redoing this and other actions because the originals date back to the Workflows days, when using the clipboard was one of the only ways to pass information back and forth between apps. Under iOS 16, using those actions results in a request for permission to paste every. single. [explective deleted]. time, which basically breaks the “one tap and done” desired behavior. There are other places I want to be able to use Shortcuts output in scripting actions, so if there is a general way to do that knowing how to do it properly would be extremely helpful.
I did hit that article first — which is good by the way, and helpful for other situations — but it didn’t cover how you can grab the output with scripting.
I could actually probably do what I was trying to do in Shortcuts by opening the Draft and doing the search-and-replace there, but I wanted to avoid that because:
I want the original Shortcut to do one thing: grab the values from two different places and combine them in a particular format. I call that same Shortcut as a kind of subroutine in a couple of other related Shortcuts so I don’t have to duplicate the steps in each Shortcut.
I wanted to figure out a bit more about scripting, since I have next to no knowledge other than copying and very lightly modifying other people’s scripts.
I wanted to just mash a button and have something find the text anywhere, not have to worry about the selection/insertion point when I trigger it.