How to bring application to foreground using Spotlight/keystrokes (named windows/named applications)?

Is there a way to put names on windows and then open them by name?

No, there is no built-in mechanism in macOS to assign names to different windows of an app and access it by names.

Spotlight generally works, but if you have more than one open application window it doesn't quite work.

When using Spotlight to search and launch an already running app, the window will be shown in the foreground in the following cases:

  1. There's only a single open app window.

  2. The app window(s) are not minimized, but hidden using the keyboard shortcut Command + H.

    If the app is hidden while none of the window is minimized, invoking app name will show all of them.

  3. If the app window(s) are minimized, only one of them is shown in the foreground.

    The other open and minimized windows can be brought to foreground using either one of the following methods:

    • Right click on the Dock icon for the app and select the window. The minimized windows are shown with a leading ◆ icon in the context menu.

    • Bring the app to foreground normally using Spotlight. Now use the Application Windows Hot Corner action to see just the app windows, maximized or minimized in a Mission Control like view.