0

I'm trying to create a way of opening a set of project files in multiple apps, using Alfred.

I know about the File Group extension in the powerpack (I have this), but as far as I can see, there's a limitation in that it only opens the files with the default app.

My usage case is this:

  • Open a .html file with Chrome
  • Open the same .html file with MacVim

Anyone know a way around this? Maybe an applescript is more what I'd need?

benui
  • 253

2 Answers2

0

1. Create a trigger and change argument

Open the alfred and create a new workflow.
Right click > Trigger > Hotkey.
You can press ctrl-cmd-o as the hotkey.

Then Change Argument to Selection in macOS.

2. Write bash script

Then write a bash script to open the selected file in multiple apps.
Right click > Actions > Run Script.
Choose /bin/bash with input as argv.

For example, to open the file (e.g. index.html) with Atom editor and Google Chrome, delete initial contents in Run Script Alfred window and paste following:

/Applications/Atom.app/Contents/MacOS/Atom "$@"
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome "$@"

You can see the snapshots below

3. Snapshots

enter image description here

enter image description here

4. Usage

Select any files in Finder. (e.g. a.htm, b.html, c.css), press ctrl-cmd-o, it will open all the files both in Atom text editor and Chrome browser.

0

invoke the action menu and pick the topmost "open with", then enter the first bits of the app name, it should then appear and by pressing return simply do what You wished!

cheers!

Alfred support cheat sheet

mat
  • 11