Applescript to open a NEW terminal window in current space

applescriptosx-snow-leopardterminal

Yes, I'm having a terrible newbie experience with Apple Script.

I need to open a new Terminal window in the current desktop space. NOT move me to another space which has a Terminal running and then open another Terminal window.

Of course, if Terminal is not running then it should start a new Terminal process.

Best Answer

tell application "Terminal"  
    do script " "  
    activate  
end tell

It seems weird but it takes advantage of an oddity in how Terminal handles incoming "do script" commands; it creates a new window for each one. You could actually replace that with something useful if you want; it'll execute whatever you want just after opening the new window.

Related Question