I always have Safari in Desktop space #3 (Safari is almost always the only app in that space). Often, when I switch to this space, Safari isn't activated. So I created a macro with the following purpose: Switch to Space #3. If Safari is running: activate it and activate the address bar.
This works perfectly. There is just a strange gray square below the address bar after simulating Cmd+L. I can close it by simulating ESC, but what's the purpose of this square? Can I prevent it from appearing?
If Safari is at the front, I can browse in the active page or press Cmd+L to change the page.
If it's not at the front, it's quite likely that I want to visit another page/search for something on the web. Then the address bar is activated (accepting input).
To Do: I have my messaging apps (Wire, Signal, Skype, iMessage, WhatsApp) in Space #4. So I'll create a macro to tile and arrange them, when Space #4 is entered.