A question on getting the database id of think window 1

Hi, thanks for asking. It’s for my script that is used to switch among databases while retaining the previously selected group and item. SwitcherV1 (Updated) with limited database context retention