Hi, @DanO333. Yes, this seemingly simple task is surprisingly elusive. I've found that it is even more difficult when the app in question is already running in a different Mission Control Desktop Space.
I've shared a set of macros in Desktop Spaces • Macros to Improve Navigation and Window Management. One macro in the set is: sub—Activate an App and Wait Until It Is Ready. My goal was to create a subroutine that could be used for any app regardless of its current state, i.e., not running, running in current space, or running in another space.
Although this sub may be more complicated than you need, you might want to give it a try. For your convenience, I've pulled it out of the set and uploaded it here: The following is v1.2 (modified 2022-07-12) and, for the time being, one version newer than the one included with the Desktop Spaces set mentioned above:
DOWNLOAD Macro File:
sub—Activate an App and Wait Until It Is Ready.kmmacros (48 KB)
Note: After downloading a reviewing this subroutine, you'll see that the app activation is fairly straightforward—notwithstanding the Finder which requires some unique actions. Ironically the app activation verification is more complicated as some applications don't follow long-standing macOS standards. The embedded complication is worth the effort, however, as many macros will fail if subsequent actions run before an application is fully ready.
And here's an example call of the subroutine:
DOWNLOAD Macro File:
Example Call (sub—Activate an App and Wait Until It Is Ready).kmmacros (1.8 KB)