Yes, I know it is possible to jump to a specific group. What I want is a function that takes the current group id, adds 1, and focusses on that group (and loop back to 0). For this I need to retrieve the current group, and the number of groups.
In sublime text 1 you would have something like the following:
groupIdx = (window.activeGroup() + 1) % window.numGroups()