I'm looking for an AppleScript (or anything, really) that will do the following:
- If a Terminal window is open in the current space, bring it to the front.
- If not, open a new one in the current space.
I don't want it to switch to another space if a Terminal window happens to be open there.
Using iTerm2 instead of Terminal is fine, if that makes things easier :).
I've been looking around for scripts that do this, but the closest I could find is one that opens a new Terminal every time. I don't want that, because I probably have a session that I want to return to.