P.S. I am not sure if it make a difference, but I am running this script via the shell using osascript .
P.P.S. Though "activate" in the last "tell application ..." seems redundant, I think it did improve reliability of the script.
===================================================================
tell application "System Events"
if not (exists process "Terminal") then
tell application "Terminal"
activate
end tell
else
tell application "Terminal"
activate
end tell
tell application "System Events"
tell process "Terminal"
tell menu bar 1
tell menu bar item "File"
tell menu "File"
click menu item "New Shell"
end tell
end tell
end tell
end tell
end tell
end if
tell application "Terminal"
activate
do script "<command to run>" in the front window
end tell
end tell
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Help/Unsubscribe/Update your Subscription: