質問

I often need to run multiple copies of an app, like VLC. For this I use the terminal and run a command similar to:

open -n /Applications/VLC.app

How can I create a shortcut with Alfred to run this one command if I type a keyword like vlcnew?

役に立ちましたか?

解決

I don't see a feature in Alfred that looks like it will enable that directly (though I might have missed it).

You can:

  1. open Automator
  2. create a new application
  3. add the "Run Shell Script" action
  4. paste in your command
  5. Select "Save..." from the file menu
  6. name it vlcnew.app

Now Alfred should find that app if you type vlcnew.

他のヒント

If you have the PowerPack, you can create a workflow.

Workflows can run bash scripts in terminal, post notifications etc..

Alfred workflow window

Now you can also run a Terminal Command using Powerpack.

  1. Create a "Blank Workflow"
  2. On the top right corner, click on the plus sign and choose the trigger you want.
  3. Click the same plus sign and now choose Actions -> Terminal Command and type whatever command you would like to run

enter image description here

You can also just open Alfred and start with a '>' in front of your query.

enter image description here

More information: https://www.alfredapp.com/help/features/terminal/

ライセンス: CC-BY-SA帰属
所属していません apple.stackexchange
scroll top