# GroupActivate

Activates the next window in a window group that was defined with GroupAdd.

    GroupActivate, GroupName , Mode

## Parameters

GroupName

  The name of the group to activate, as originally defined by GroupAdd.

Mode

  If omitted, the command activates the oldest window in the series. To change this behavior, specify the following letter:

  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.

## ErrorLevel [AHK_L 54+]

ErrorLevel is set to 1 if no window was found to activate or 0 otherwise.

## Remarks

This command causes the first window that matches any of the group's window specifications to be activated. Using it a second time will activate the next window in the series and so on. Normally, it is assigned to a hotkey so that this window-traversal behavior is automated by pressing that key.

When a window is activated immediately after another window was activated, task bar buttons may start flashing on some systems (depending on OS and settings). To prevent this, use #WinActivateForce.

See GroupAdd for more details about window groups.

## Related

GroupAdd, GroupDeactivate, GroupClose, #WinActivateForce

## Examples

#1

    GroupActivate, MyGroup, R