Jump to content

Run command against all items from list of Alfred choices

Recommended Posts

Objective of this workflow is to close all Chrome tabs matching a keyword typed by the user.


I can successfully list all the tabs for a given keyword (using a Script Filter + word matching from Alfred), see screenshot.

I now want to close every of these listed tabs when pressing Enter, contrarily to closing only the current selection !


How can i achieve such behavior ? Which Alfred workflow component should i use?


PS: I'm fine to have multi selection panel (Shift + arrow down), then Enter to close the multiple selections at once, if possible in Alfred.



Edited by Luc
Link to comment

Welcome @Luc,


There is an Automation Task specifically for this. Extra Automation Tasks → Web Browsers → Chromium Browsers → Close Chromium Browser Tags With Matching URL. Use {query} in Match For to use the input from your Script Filter.


The selection the Automation Task uses may not be the same as your Script Filter, because your Script Filter is custom. In which case, you’d have to make the close script be custom too (via Run Script Action). Note you can pass an array to arg in your Script Filter and the next object will see it as multiple arguments.


Edited by vitor
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...