Closed nikitavoloboev closed 6 years ago
Unfortunately, windows aren't zero-indexed. You don't need to worry about sessions (which are indexed by uuid). Something along the following lines should work:
var iterm = Application("com.googlecode.iterm2");
var fgWinId = iterm.windows.id()[0];
var fgWin = iterm.windows.byId(fgWinId);
var secondTab = fgWin.tabs[1];
secondTab.select();
fgWin.select();
iterm.activate();
I want to make a hotkey that would open the second tab of iTerm when activated.
I tried to transfer the main part of the code like so :
Also I call this JXA from Keyboard Maestro like so :
I am quite new to JXA but I am kind of confused by this.
Thank you for any help.