UPDATED 2019.09.26: I have attached script V2.2 that supersedes all previous versions.
This script might become obsolete very soon . See Feature request DEVONthink Pro 3: 3 pane view & tabbed windows
The script uses a popup list to switch between sidebar, view, preview, inspector bar, and database. The script will retain the latest context of an opened database (selected document, group, or search results) in each opened main window when user begins to use the script to switch among databases in main windows. Maximum of 5 opened main windows and 20 opened databases.
Options: The script can show database list only, or together with a list of 9 views in DT menu>view. User can assign numeric labeling to the view list and/or alphabetical labeling to database list.
Limitation: I only test the database context retention for list view and column view. Retention for icon and cover flow views have not been tested. If multiple items are selected, only the first item in the selection will remain selected after the switch. It is possible that sometimes the script might not be able to retain the database context. But a quick fix procedure will resolve the issue in most of the time.
I suggest putting the script in the DT3 script menu and assign the script a shortcut, by direct naming or in the MacOS system preference. The attached script in post#2 is assigned with ctrl-Q as an example.
Demo (these are images for an older version, the uncluttered version is shown in post#3)
(1) View in DB1, a file is selected. Invoke the script and switch to DB2. Global inbox (“Inbox”) will always be the first database in the db list.
(2) Switched to DB2. Invoke the script and switch to DB1 again.
(3) The previously selected item is retained.
Script and option setting in post#2