A popover is not a window. It's more like a special purpose tab control. Thus Window functions do not apply.
An "active" object is the object that currently has the focus, not the popover that is currently open. Which field that currently has a cursor in it would be the active layout object. A button can have the focus, but not because you clicked or tapped it. (That seems strange, but it's an important aspect of FileMaker's interface design that would keep certain other key features from working if it were not true.) A button can get the focus when you exit a field by pressing a key that exits the current field and the button is set to be the next object in the layout's tab order. A popover button will get the focus when the popover panel is closed in a way that does not set the focus somewhere else (such as when the Close Popover script step closes it).
I want the table-unique id.
The current table occurrence name can be accessed via Get ( LayoutTableName ) while this get function parameter says "table" it's really the table occurrence specified in Layout Setup|Show Records From for the current layout.
Only one popover can be open at a time and the OnObjectEnter trigger set on the popover panel (not the button) will be tripped when the popover opens. Thus, a script performed by this trigger can set a global variable to a value that identifies the currently open popover. Any scripts that then need to access this data can simply reference the global variable.