Last active
April 16, 2017 02:02
-
-
Save guiwuff/f99b4815785bbd8a4a5cd4d11e90fa63 to your computer and use it in GitHub Desktop.
open iTerm from Finder toolbar using Automator App
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
# Reference : https://gist.github.com/pdanford/158d74e2026f393e953ed43ff8168ec1 | |
# Open Automator -> Application -> Action -> Run Apple Script | |
on run {input, parameters} | |
tell application "Finder" | |
set dir_path to quoted form of (POSIX path of (folder of the front window as alias)) | |
end tell | |
CD_to(dir_path) | |
end run | |
on CD_to(theDir) | |
tell application "iTerm" | |
activate | |
set win to (create window with default profile) | |
set sesh to (current session of win) | |
tell sesh to write text "cd " & theDir & ";clear" | |
end tell | |
end CD_to | |
# Save as : iTermOpenScript.app, view the app in finder, drag & drop to the Finder toolbar | |
# Replace the icon by accessing get info of the app file | |
# Open /Applications/iTerm.app/Contents/Resources/Appicon.icns in your image viewer / preview, Select All and Paste into Get Info dialog window. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Screenshot