Browse code

Add iTerm version of tab function (itab)

Ben Langfeld authored on 18/02/2011 at 12:48:27
Showing 1 changed files
... ...
@@ -30,3 +30,28 @@ end do_submenu
30 30
 do_submenu("Terminal", "Shell", "New Tab", 1)
31 31
 EOF
32 32
 }
33
+
34
+function itab() {
35
+savepath
36
+osascript >/dev/null <<EOF
37
+on do_submenu(app_name, menu_name, menu_item)
38
+    -- bring the target application to the front
39
+    tell application app_name
40
+      activate
41
+    end tell
42
+    tell application "System Events"
43
+      tell process app_name
44
+        tell menu bar 1
45
+          tell menu bar item menu_name
46
+            tell menu menu_name
47
+              click menu item menu_item
48
+            end tell
49
+          end tell
50
+        end tell
51
+      end tell
52
+    end tell
53
+end do_submenu
54
+
55
+do_submenu("iTerm", "Shell", "New Tab")
56
+EOF
57
+}