Created
August 1, 2018 05:28
-
-
Save Tattoo/5f0097f9c422f7b7c3491ec464d73fff 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