If you’re a macOS user and frequently open folders in the Terminal, you might find it convenient to have a dedicated “Open in Terminal” icon in the Finder. This tutorial will guide you through the process of adding this icon to your Finder toolbar.

Step 1: Open Automator and select “Application” when prompted to choose a type of document.

Step 2: Search for “Run AppleScript” in the list of available actions and add it to your workflow.

Step 3: Paste the following lines of AppleScript into the text editor:

on run {input, parameters}
    tell application "Finder"
        set myPath to (POSIX path of (target of front window as alias))
    end tell
    
    tell application "Terminal"
        do script "cd " & myPath
        activate
    end tell
    
    return input
end run

Alternatively, if you prefer using bash script, you can use the “Run Shell Script” action instead and write the following script:

osascript -e '
tell application "Finder"
    set myPath to (POSIX path of (target of front window as alias))
end tell

tell application "Terminal"
    do script "cd " & myPath
    activate
end tell
'

Step 4: Save the application in the Applications folder. Then, right-click on the application and select “Get Info” to change its icon.

Step 5: Open a new Finder window and navigate to your Utilities folder. Open the “Terminal” application from there. Drag its icon to the small icon in the top-left corner of the “Get Info” window for your newly created application to use the Terminal icon.

Step 6: Finally, hold the ⌘ command key and drag the application to your Finder toolbar.

That’s it! You now have an “Open in Terminal” icon in your macOS Finder toolbar, making it easier than ever to open folders directly in the Terminal.