$activecid
From Scriptwiki
Returns the connection id of the currently active window.
$activecid
See Also
To get the connection if of the last active window, look at $lactivecid.
To react on windows changes, look at the On active event.