View difference between Paste ID: MSPZWWAj and AQzieBvL
SHOW: | | - or go back to the newest paste.
1
-- More robust version of https://gist.github.com/2006738
2
3
tell application "BBEdit" to set theFile to file of document 1
4
tell application "Finder" to set theFolder to (container of file theFile) as alias
5
set theUnixPath to POSIX path of theFolder
6
7
tell application "iTerm"
8
	activate
9
	set myterm to (make new terminal)
10
	tell myterm
11
		launch session "Default"
12
		tell the last session
13
			write text "pushd  \"" & theUnixPath & "\"" & "&& clear"
14
		end tell
15
	end tell
16
end tell