0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Homebrew製アプリをAlfred5から起動する方法

Last updated at Posted at 2025-01-14

多くのMacユーザーが慣れ親しんでいるコマンドランチャーのAlfredですが、Homebrewとの相性が悪くて毎回悩んでいませんか?筆者はHomebrewでインストールしたEmacsをAlfredから使う方法について何度もググっているので、いい加減まとめてみました。

前提:Alfred5について

筆者は長年MacのApp StoreアプリからAlfredをインストールしていたのですが、App Store経由でインストールされるAlfredはバージョン1.2(2012年リリース!)です。化石です。

2025年現在、最新のAlfredはバージョン5.5です。Alfred公式サイトから直接ダウンロードしましょう。

手順1: Homebrew製アプリのインストール

まずお好きなHomebrew製アプリをインストールしましょう。Emacsの場合なら以下のようにインストールします。

$ brew tap railwaycat/emacsmacport
$ brew install emacs-mac

手順2: macOSエイリアスの作成

/Applications 以下に今インストールしたappのエイリアスを作ります。これはシンボリックリンクとは別の機能で、macOSネイティブの仕組みのようです。

ターミナルから下記のようにコマンドを打ちます。(別のアプリを使う場合はよしなに変更してください)

osascript -e "tell application \"Finder\" to make alias file to POSIX file \"$(brew --prefix emacs-mac)/Emacs.app\" at POSIX file \"/Applications\""

ダイアログが出るので「許可」を選びます。

image.png

手順3: Alfredの設定

  1. Alfredの設定画面を開く
    • AlfredのPreferencesを開き、Features > Default Resultsに移動
  2. エイリアスを検索対象に追加
    • ExtrasのAdvancedをクリックし、ポップアップウィンドウでファイルタイプの追加
    • Finderの/Applicationsウィンドウからエイリアスをドラッグしてポップアップウィンドウに追加

image.png

動作確認

Alfredで「emacs」を検索し、先ほど作ったエイリアスが表示されるか確認します。

注意点

これをやると全てのエイリアスがAlfredの検索対象になってしまいます。特に困らないと思いますが。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?