As a user of Mission Control Desktop Spaces you might want to check out this post: Desktop Spaces • Macros to Improve Navigation and Window Management
I've actually been deep into macro programming of the Finder. If you want to jump in with both feet, I suggest you consider this: Want to Help Test a Finder-related Macro?
In most cases, when I have one or more Finder windows open in a space, if I want to add a new target path, I open a new Finder tab in the frontmost window (versus a new window in the space).
Here's a old standalone subroutine macro and two calling macros that you might want to try.
Finder—New Tab in Space (shared KM Forum 2023-08-16) Macros.kmmacros (32.4 KB)
Macro-Notes
- Macros are always disabled when imported into the Keyboard Maestro Editor.
- The user must ensure the macro is enabled.
- The user must also ensure the macro's parent macro-group is enabled.
System Information
- macOS 13.4.1 (22F770820d)
- Keyboard Maestro v10.2