Forked from Tattoo/gist:5f0097f9c422f7b7c3491ec464d73fff
Last active
September 15, 2021 02:26
-
-
Save nelsestu/8fb7ab5b761c3bc344205c0410b88030 to your computer and use it in GitHub Desktop.
"Open iTerm here" context menu for Finder in OS X
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Step 1 | |
# Open Automator | |
# | |
# Step 2 | |
# File - New - Service | |
# | |
# Set the top dropdown boxes to Service receives selected files or folders in Finder.app | |
# Double click or drag Run Shell Script from the left panel, and enter the following: | |
if [[ -d $1 ]]; then | |
open -a iTerm $1 | |
elif [[ -f $1 ]]; then | |
parentdir="$(dirname "$1")" | |
open -a iTerm $parentdir | |
fi | |
# Step 3 | |
# File - Save - Save service as Open iTerm Here | |
# | |
# It is stored in ~/Library/Services, in case it needs to be changed later. | |
# | |
# That’s it! Now you can see the Open iTerm Here context menu option by right click on a file or folder in Finder. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment