Terminal – Open via AppleScript with Shortcut

applescriptapplicationsshortcutterminal

I'm tring to write a shortcut script in spark for opening the terminal.

on run {input, parameters}

  tell application "Utilities/Terminal" // tried Utilities:Terminal and Terminal too
    reopen
    activate
  end tell

end run

how can make this work? I'm using 10.10.2 as OSX version.

Best Answer

This is the correct method:

tell application "Terminal"
    if not (exists window 1) then reopen
    activate
    -- insert your code here
end tell

EDIT You can open new windows with do script

tell application "Terminal"
    do script ""
end tell