okay -actually- get it to focus the new window

Thu, 22 Mar 2018 15:24:14 -0400

author
Meredith Howard <mhoward@roomag.org>
date
Thu, 22 Mar 2018 15:24:14 -0400
changeset 705
7520062c1461
parent 704
7118c036f770
child 706
d61b23bfb605

okay -actually- get it to focus the new window

.hammerspoon/init.lua file | annotate | diff | comparison | revisions
--- a/.hammerspoon/init.lua
+++ b/.hammerspoon/init.lua
@@ -40,8 +40,10 @@ cmdCtrl('right', function () focusedWind
 cmd('return', function ()
   hs.applescript.applescript([[
     tell application "iTerm"
-      set newterm to (create window with default profile)
-      activate window newterm
+      set newterm to index of (create window with default profile)
+      tell application "System Events" to tell process "iTerm2"
+        perform action "AXRaise" of window newterm
+      end tell
     end tell
   ]])
 end)

mercurial