I have requirement to open multiple tab's and invoke some services and then close them as part of shutdown.
For now all I have tried is
osascript -e 'tell application "Terminal" to activate' -e 'tell application "System Events" to tell process "Terminal" to keystroke "t" using command down'
It opens a tab; but how can I
a) Give the tab a name
b) Invoke a process
Also I have tried
osascript -e 'tell application "Terminal" to activate' -e 'tell application "System Events" to tell process "Terminal" to keystroke "t" using command down' -e 'tell application "Terminal" to do script "echo hello" in selected tab of the front window'
Which prints hello in the main window from where I had invoked the script.
Any suggestions would be helpful.