First connect to the server and wait for 6 seconds (you can change that) and then execute whatever you need on the remote server using the same tab
tell application "Terminal"
set currentTab to do script ("ssh user@server;")
delay 6
do script ("do something remote") in currentTab
end tell
Related Contents:
- How do I make a Mac Terminal pop-up/alert? Applescript?
- Open terminal here in Mac OS finder [closed]
- Run / Open VSCode from Mac Terminal
- OS X Terminal Colors [closed]
- Open Sublime Text from Terminal in macOS
- Mac OS X Terminal: Map option+delete to “backward delete word”
- (Mac) -bash: __git_ps1: command not found
- How can I increase the cursor speed in terminal? [closed]
- How can I set my default shell on a Mac, e.g. to Fish? [closed]
- How to copy files across computers using SSH and MAC OS X Terminal [closed]
- After installing Homebrew I get `zsh: command not found: brew`
- “You have mail” message in terminal, os X [closed]
- OS X Terminal shortcut: Jump to beginning/end of line
- How to move up a directory with Terminal in OS X
- Is there a way to give a specific file name when saving a file via cURL?
- iTerm2: delete line?
- Terminal error: zsh: permission denied: ./startup.sh
- See what process is accessing a file in Mac OS X
- Gulp command not found after install
- Running a command in a new Mac OS X Terminal window
- Mac Terminal Auto Complete
- What are the differences between using the terminal on a mac vs linux? [closed]
- Scrolling inside Vim in Mac’s Terminal
- Print rpath of an executable on macOS
- -bash: export: `=’: not a valid identifier
- Finding all files with certain extension in Unix?
- How can I make directory writable? [closed]
- Command Line Tools bash (git) not working – macOS Sierra final release candidate
- Changing file extensions for all files in a directory on OS X
- Delete specific line from Zsh history
- Terminal Commands: For loop with echo
- Remove “Last login” message for new tabs in terminal
- Using ‘make’ on OS X
- How can I batch rename files using the Terminal?
- Where do you keep your own scripts on OSX? [closed]
- karma command not found when karma already installed
- Pasting code into terminal window into vim on Mac OS X
- Difference between .profile and .bash_profile on Snow Leopard
- Howto go to beginning of line in tmux after remapping prefix to CTRL+A?
- chown illegal group name (mac os x) [closed]
- Running an executable in Mac Terminal
- How to download a file using curl
- iTerm2 Transparent transparent background for inactive windows
- “You don’t have write permissions for the /usr/bin directory.” when installing Sass using the Gem command
- Command key as Meta key in OS X Terminal.app
- Error message when starting vim: “Failed to set locale category LC_NUMERIC to en_CH” (or en_BR, en_RU & LC_TIME, LC_COLLATE, LC_MONETARY, LC_MESSAGES)
- Adding timestamp to each line on Zsh
- MacOSX: autostart mysql on boot
- OS X Terminal UTF-8 issues
- OSX Lion AppleScript : How to get current space # from mission control?