Source Code : 
tell application "Terminal" to activate
tell application 
"System Events"
    
tell process "Terminal"
        
click menu item "New Window" of menu "Shell" of menu bar 1
        tell application 
"Terminal" to close the front window
    end tell

[Login or Register to remove this advertisement]

end tell 
Xcode Reviewed by Xcode on . Clicking menu items using AppleScript tell application "Terminal" to activate tell application "System Events" tell process "Terminal" click menu item "New Window" of menu "Shell" of menu bar 1 tell application "Terminal" to close the front window end tell end tell Rating: 5