LoginSignup
8
9

More than 5 years have passed since last update.

Finderの現在地をターミナルで開くボタン

Last updated at Posted at 2015-10-16

ゴール

カレントフォルダをターミナルで開くボタンを作る
Screenshot 2015-10-16 17.50.33.png

やりかた

Automaterを開き,"Application"を選択
Screenshot 2015-10-15 17.27.31.png
"Get Selected Finder items"をワークスペースにドロップ
Screenshot 2015-10-15 17.28.03.png

"Run AppleScript"を同様にドロップ
Screenshot 2015-10-15 17.28.30.png

ダミーのコードを消し,以下をペースト

on run {input, parameters}
    tell application "Finder"
        set myWin to window 1
        set theWin to (quoted form of POSIX path of (target of myWin as alias))
        tell application "Terminal"
            activate
            tell window 1
                do script "cd " & theWin
                -- do script "cd " & theWin & ";ls -al | more"
            end tell
        end tell
    end tell
    return input
end run

⌘+sで"ファイル名.app"を保存する.(名前は適当に)
保存した場所へFinderで行き,⌘を押しながら"ファイル名.app"をFinderのツールバーにドロップ.

おまけ

アイコンがかっこ悪いので,好きなものに変えましょう.

  1. "ファイル名.app"を選択し⌘+i
  2. このアイコンicn.png を直接オートメータさんへドロップ

Untitled.tiff

参考

8
9
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
8
9