How to launch terminal commands into multiple tabs

mac-osxscriptingterminal

Is there a way with Applescript to launch multiple tabs in Terminal and execute commands against them?

I have a project that requires me to launch several services in Terminal to run and monitor simultaneously and would like to automate that start-up process.

Best Answer

One option is to use System Events to send the keystroke necessary to create the new tab, but the limitation is that Assistive Devices in Universal Access must be turned on and adding a sight delay may be necessary.

tell application "System Events" to tell process "Terminal" to keystroke "t" using command down

As far as I can discern from the Terminal script dictionary - you can only retrieve information from tabs but not create new ones as you could with windows (eg. Run do script "clear"