Jump to content

Workflow to open new Terminal tab in currently opened window

Recommended Posts

AppleScript is your friend. Unfortunately, Terminal's scripting support sucks, so you have to simulate keyboard shortcuts instead:
tell application "System Events"

    tell application process "Terminal"

        set frontmost to true

        keystroke "t" using command down

    end tell

end tell

On my machine, that opens a new Terminal window if none is open, and creates a new tab in the front window otherwise.

Edited by deanishe
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...