macOS: How to add an “Open in Terminal” icon in macOS Finder

Join the AI Workshop to learn more about AI and how it can be applied to web development. Next cohort February 1st, 2026

The AI-first Web Development BOOTCAMP cohort starts February 24th, 2026. 10 weeks of intensive training and hands-on projects.


Let’s say I’m in the Finder, I open a folder and I want to open it in the Terminal.

I decided to make it easy by adding an “Open in Terminal” icon in the Finder:

Here’s how you can do that too.

Open Automator. Pick “Application”

Search for “Run AppleScript” in the list of actions, and paste these lines:

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

If you prefer you can use “Run Shell Script” instead, and write this bash 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
'

The first runs osascript (which is a script to run AppleScript) with the following AppleScript

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

which basically gets the current opened folder absolute path and stores it to the myPath variable.

Then we open the Terminal app and we run the cd command to go into that folder.

Save this application in the Applications folder and then click Get Info to change its icon.

You can open Get info on the Terminal app in the Utilities folder, and drag its icon to the top-left small icon to assign that icon to our new little app.

Finally keep the ⌘ command key pressed and drag the app in the Finder toolbar.

That’s it!

Lessons in this unit:

0: Introduction
1: How to use the macOS terminal
2: Productivity gains of using a Mac and an iOS device
3: A way to set up automations in macOS easily
4: How to hide a file or folder in macOS Finder
5: How to install a local SSL certificate in macOS
6: Reverting a file to a previous version, on a Mac
7: Take screenshots as JPG on macOS
8: Convert an image or resize it using macOS Shortcuts
9: Concatenating videos on macOS
10: Fix files creation date in macOS
11: Freeing space on a Mac
12: ▶︎ How to add an “Open in Terminal” icon in macOS Finder
13: How to add an “Open in VS Code” icon in macOS Finder
14: How to find the bundle ID of a Mac app
15: How to Fix the "Your CLT does not support macOS 11" error in macOS
16: How to play a sound from the macOS command line
17: How to remove the shadow from window screenshots in macOS
18: Removing all Homebrew stuff
19: Run a Node.js script from your macOS menu bar