summaryrefslogtreecommitdiff
path: root/plugins/externaltools/data/open-terminal-here-osx.tool.in
diff options
context:
space:
mode:
authorPerberos <[email protected]>2011-11-07 16:46:58 -0300
committerPerberos <[email protected]>2011-11-07 16:46:58 -0300
commit528c1e5ff51e213936e800fc5a9a25da99c0bdf2 (patch)
tree77f8aa456b09367ba81f04d4562fc935f898a951 /plugins/externaltools/data/open-terminal-here-osx.tool.in
downloadpluma-528c1e5ff51e213936e800fc5a9a25da99c0bdf2.tar.bz2
pluma-528c1e5ff51e213936e800fc5a9a25da99c0bdf2.tar.xz
initial
Diffstat (limited to 'plugins/externaltools/data/open-terminal-here-osx.tool.in')
-rwxr-xr-xplugins/externaltools/data/open-terminal-here-osx.tool.in16
1 files changed, 16 insertions, 0 deletions
diff --git a/plugins/externaltools/data/open-terminal-here-osx.tool.in b/plugins/externaltools/data/open-terminal-here-osx.tool.in
new file mode 100755
index 00000000..c3360064
--- /dev/null
+++ b/plugins/externaltools/data/open-terminal-here-osx.tool.in
@@ -0,0 +1,16 @@
+#!/usr/bin/osascript
+
+set the_path to system attribute "GEDIT_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