GroupClose

Closes the active window if it was just activated by GroupActivate or GroupDeactivate. It then activates the next window in the series. It can also close all windows in a group.

GroupClose, GroupName , Mode

Parameters

GroupName

The name of the group as originally defined by GroupAdd.

Mode

If blank or omitted, the command closes the active window and activates the oldest window in the series. Otherwise, specify one of the following letters:

R: The newest window (the one most recently active) is activated, but only if no members of the group are active when the command is given. "R" is useful in cases where you temporarily switch to working on an unrelated task. When you return to the group via GroupActivate, GroupDeactivate, or GroupClose, the window you were most recently working with is activated rather than the oldest window.

A: All members of the group will be closed. This is the same effect as WinClose ahk_group GroupName.

Remarks

When the Mode parameter is not "A", the behavior of this command is determined by whether the previous action on GroupName was GroupActivate or GroupDeactivate. If it was GroupDeactivate, this command will close the active window only if it is not a member of the group (otherwise it will do nothing). If it was GroupActivate or nothing, this command will close the active window only if it is a member of the group (otherwise it will do nothing). This behavior allows GroupClose to be assigned to a hotkey as a companion to GroupName's GroupActivate or GroupDeactivate hotkey.

When the active window closes, the system typically activates the next most recently active window. If the newly active window is a match for the same window specification as the window that was just closed, it is left active even though the default Mode would normally dictate that the oldest window should be activated next. [v1.1.35+]: If the newly active window is a match for any of the group's window specifications, it is left active.

See GroupAdd for more details about window groups.

GroupAdd, GroupActivate, GroupDeactivate

Examples

Closes the active window activated by GroupActivate or GroupDeactivate and activates the newest window (the one most recently active) in a window group.

GroupClose, MyGroup, R