xed/plugins/externaltools/data/open-terminal-here-osx.tool.in

17 lines
396 B
Plaintext
Raw Normal View History

2011-11-07 13:46:58 -06:00
#!/usr/bin/osascript
2011-11-07 16:52:18 -06:00
set the_path to system attribute "PLUMA_CURRENT_DOCUMENT_DIR"
2011-11-07 13:46:58 -06:00
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