AppleScript "create window" focuses wrong window on multi-monitor
- iTerm2 version: 3.1.5
- OS version: High Sierra (10.13.2)
Detailed steps to reproduce the problem:
- Have multiple monitors.
- Open at least one iTerm window on the left monitor, but none on the right monitor.
- Give focus to something on the right monitor.
- Trigger the applescript to create a new window.
What happened: The pre-existing iTerm window on the left monitor receives focus.
What should have happened: The new iTerm window on the right monitor receives focus.
Additional info:
I trigger the applescript with Hammerspoon, with the following Hammerspoon script:
function newItermWindow()
hs.applescript.applescript([[
tell application "iTerm"
create window with default profile
end tell
]])
end
hs.hotkey.bind("alt", "space", function() newItermWindow() end)
Edited by Jan Ouwens