summaryrefslogtreecommitdiff
path: root/plugins/externaltools/data/open-terminal-here-osx.tool.in
blob: 86d842dcab85319d49521494ac2b7315d0fc2bd9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/osascript

set the_path to system attribute "PLUMA_CURRENT_DOCUMENT_DIR"
set cmd to "cd " & quoted form of the_path

tell application "System Events" to set terminalIsRunning to exists application process "Terminal"

tell application "Terminal"
	activate
	
	if terminalIsRunning is true then
		do script with command cmd
	else
		do script with command cmd in window 1
	end if
end tell