Action chaining

It may be useful to be able to combine (or link, or pipe) two or more PopClip actions into a chain so that the output of one is the input of the next.

This following discussion has been split off from another topic:

One thing that’s cool is that you can combine it with the Sort extension to sort a comma separated list. As in, Split commas into lines → Sort lines → Join lines with commas

Of course, this does bring to mind the possibiliy of compound actions, where a sequence of actions could be chained to make another action :thinking:

2 Likes

As long as the text stays highlighted, it’s just a matter of a couple taps right?

But compound actions would be cool

There’s a couple of ways I can see it could work. First would be hold, say, the ⌘ key when clicking the action, to keep the PopClip bar open and allow inputting further actions. Another would be to have a way to “pre bake” compound actions.

None will happen super quick, would take some though to geth the UI right. But it does seem very natural.

1 Like

I like the idea of using a modifier key to chain extensions. But don’t some extensions use a modifier key to change what they do?

One or two of mine do, and I’m sure there are more that other people have made that do. Currently the shift key has a special meaning for all extensions (copies result instead of paste). So this would be introducing another modifier key with a special meaning. Since PopClip has no way to know which 3rd party extensions currently use a given modifier, I imagine I would implement either an opt-in or opt-out mechanism.

More broadly it’s quite an interesting problem, because there are heuristics that you could apply to extension actions to determine whether they receive text input, and whether they give text as output, So as to know whether they can participate in chaining or not.

1 Like

Hello everyone,
Is it possible to link (pipe ?) two extensions?
Very simple exemple would be… I mark a text and I want to put brackets around and also make it Bold in one action ?
Thank you

1 Like

Hello, great question. No it’s not possible, but this is something I’m actively thinking about. You can see some discussion of it here: Action chaining. I’m going to merge this thread into that thread to keep things tidy :nerd_face:

Just an example of action chaining I’d love to be able to do: take a tab-, comma- or newline-separated list, convert it into one of the others, and wrap or strip quotes from each item.

E.g., turn

"a", "b", "c"

into

a
b
c

and vice versa. Very handy for turning cells in a spreadsheet into a Python or javascript list…

1 Like