Any reason the actions would not register? I’ve restarted Shortcuts, but still get unknown actions and no listing for Bike.
In terms of the shortcut, is it actually getting tab details for you? So far, I have never got lists of records to be returned by AppleScript in Shortcuts - as illustrated by the example. I tried stripping down the shortcut above and that also wasn’t giving me any output from the AppleScript.
And that one line does typically work.
These related discussions might be useful for people to scan through too. - they are about dictionaries in AppleScript, and passing data out of Shortcuts.
Given I can’t currently get the Bike app shortcuts action to work/appear, I have built a separate Bike-independent example to show some alternatives.
Here, I’ve written some AppleScript to build a JSON string (which can be read into a Shortcuts dictionary) of tab data of the following sort of format:
"tabs" : [
"tabURL" : "https://www.taskpaper.com",
"tabName" : "TaskPaper – Plain text to-do lists for Mac"
"tabURL" : "https://www.hogbaysoftware.com/bike/",
"tabName" : "Bike Outliner: Outline writing, lists, and notes app for Mac"
The shortcut explicitly transforms it into a dictionary.
The repeat loop operates not on the dictionary as a whole, but explicitly the values of the
tabs key of the dictionary - i.e. the JSON array of the tab data.
The Text action is just illustrative to show how you can direct access the data elements of the JSON in each array element without having to get it in a separate action. In the screenshot below, you can see the Repeat Item variable is explicitly set to a type of Dictionary, and the key is set as
tabURL. As such, in the original shortcut, you shjould indeed be able to slim things down in the repeat loop.
The repeat loop dumps out each Text action, so in the screenshot of this example, you can see I had 10 tabs open in my front most Safari window, and that the fourth tab was this topic.
Hope that helps clear things up, and do let me know if you have any ideas how to get the shortcuts for Bike to appear (happy to poke around and see what I can do with the shortcuts actions it provides). The only thing I haven’t tried yet is a reboot, but normally you don’t have to reboot to get Shortcuts actions for an app to show up.