Scripting: accessors for is-focused/is-visible attributes of things
By shab... on September 11, 2014 19:12 (imported from Google Code)
The existing 'get current <window|tab|session>' does not indicate if the current thing is actually onscreen somewhere, and/or if it is the actively focused application window.
the 'focus' property should be true for any <thing> that will respond to your keystrokes at the current moment. (probably, a window, a tab, and a session. Setting 'broadcast input' /may/ result in multiple focused sessions).
If iterm as a whole is not the active application, nothing will have focus.
the 'visible' property should be true for any <thing> that is the (global) frontmost window on the current Space of any display. (accessors indicating which screen/Space would also be desirable)
Partially visible windows (not frontmost in the window stack) are not considered visible if anything obstructs them. (So splitting a Space into a 50% browser, 50% iterm window would be visible due to 0 overlap, even if the browser is focused/active. but 51%/50% would be non-visible)
the hotkey window should probably always be considered visible if it is active.
Accessors may be writable to raise/hide windows and give them keyboard focus.
Setting visibility/focus on a session or tab would propagate to the parent tab/window/app.
(This could augment/replace the 'select session x of y' and 'tell x to activate' current API)