Sending text to an open terminal window with automator

automatorterminal

I'm trying to create a simple workflow to type commands into an open Terminal window that has focus. I want to run the script when I give a dictation command with Terminal open.

I created a simple workflow to run a shell command to test this out. It runs, but doesn't do anything inside the open terminal window. How I can achieve this?

enter image description here

Best Answer

OK, I created an AppleScript inside automator that did the trick:

tell application "Terminal"
    set currentTab to do script ("ssh me@10.0.1.25;") in front window
end tell