#!/bin/sh
#-------------------------------------------------
# http://www.ss64.com/osx/osascript.html
# http://snippets.dzone.com/tag/iTerm
# 
# Eclipse Aufruf: http://blog.eflow.org/archives/64
#

GOTOPATH="$1"
osascript <<END
tell application "iTerm"
    activate
    #delay 1
    tell the first terminal
	launch session "Default Session"
	tell the last session
	
	write text "cd " & "$GOTOPATH\n"
	write text "clear\n"	
	write text "pwd\n"
	end tell
    end tell
end tell
END
