MultiActions Showing Multiple Times on Snippet

When I create the extension-snippet below I get way more options that I installed.

# popclip SearchLink + Multi Actions
name: SearchLink Actions
icon: search s
actions:
- title: SearchLink Copy 
- icon: search c
- applescript: do shell script "automator -r -i \"{popclip text}\" ~/Library/Services/SearchLink.workflow|awk '/http/{gsub(/^[ \t]*\"|\"[ \t]*$/,\"\"); print}'|pbcopy"
- title: Searchlink Open
- icon: search o
- applescript: do shell script "open $(automator -r -i \"{popclip text}\" ~/Library/Services/SearchLink.workflow|grep -o \"https://*.* \")"; print})"

Too many hyphens! Each hyphen starts a new array item so this is actually defining 6 actions. I’m on iPhone now so hard to type out, but take away the hyphens on the icon: and AppleScript: lines.

YAML syntax is handy but has certain quirks, in particular it took me a while to click the way hyphens worked,.

1 Like

This is what @nick means:


# popclip SearchLink + Multi Actions
name: SearchLink Actions
icon: search s
actions:
- title: SearchLink Copy 
  icon: search c
  applescript: do shell script "automator -r -i \"{popclip text}\" ~/Library/Services/SearchLink.workflow|awk '/http/{gsub(/^[ \t]*\"|\"[ \t]*$/,\"\"); print}'|pbcopy"
- title: Searchlink Open
  icon: search o
  applescript: do shell script "open $(automator -r -i \"{popclip text}\" ~/Library/Services/SearchLink.workflow|grep -o \"https://*.* \")"; print})"

Conceptually, think of each hyphen as indicating a new member of the actions list; but each member of the list consists of three items — the title, icon and applescript… so you’re making a list of two groups of things, not a list of six things.

2 Likes