Opening a new terminal window -- with spaces

There are many times where I’d like to open a new terminal, in my current space. Using Alt-Tab to find terminal, will send me to another space, if it’s open.

But, using the dock, works fine. So, I’ve been trying to use the dock to spawn a new terminal, but I can’t figure out what I’m doing wrong. Here’s how I’m trying it. Feel free to correct me, or even point me in a new direction (other than clicking that flag in spaces that says NOT to take you to the space – I like the feature when alt-tabbing to mail.app)

tell application "System Events"
	if not (exists process "Terminal") then
		tell application "Terminal"
			activate
		end tell
	else
		tell application "System Events" to tell process "Dock"
			tell UI element "Terminal" of list 1
				perform action "AXShowMenu"
				tell menu 1
					tell menu item "New Window"
						tell menu "New Window"
							click menu item "Pro"
						end tell
					end tell
				end tell
				
			end tell
		end tell
	end if
end tell

You can get a new Terminal window in your current space using the following.
Any command will do but pwd has a short result.


tell application "Terminal" to do script with command "pwd"

That was just way too easy. If you had any idea how long I’ve been trying to figure that out!

Glad I could help!