Skip to content

Instantly share code, notes, and snippets.

@atian25
Forked from Rpsl/terminal.sh
Last active August 29, 2015 14:17
Show Gist options
  • Save atian25/2ef612d3a812f1d3bf58 to your computer and use it in GitHub Desktop.
Save atian25/2ef612d3a812f1d3bf58 to your computer and use it in GitHub Desktop.
cd ~/Library/Application\ Support/WebStorm9/NativeNeighbourhood/classes/org/intellij/plugins/nativeNeighbourhood/icons/macosx
echo '#!/bin/sh
#
# Reveal a directory in the Terminal.
#
# The script takes one argument, the qualified name of a directory.
#
# Note that the script is necessary because osascript before osx 10.4 could not
# pass arguments.
#
/usr/bin/osascript <<EOF
tell application "iTerm"
activate
delay 1
-- talk to the first terminal
tell the first terminal
try
-- launch a default shell in a new tab in the same terminal
launch session "Default Session"
on error
display dialog "There was an error creating a new tab in iTerm." buttons {"OK"}
end try
tell the last session
try
-- cd to the finder window
write text "cd $1"
on error
display dialog "There was an error cding to the finder window." buttons {"OK"}
end try
end tell
end tell
end tell
EOF' > terminal.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment