Well, did it through applescript 😎
tell application "Terminal"
activate
end tell
delay 3 -- seconds
tell application "System Events"
keystroke "ssh mac@192.168.0.10"
keystroke return
delay 3
keystroke "password"
-- if you went to press return after typing the password
keystroke return
delay 3
keystroke "h" using command down
end tell
I posted an Applescript program.
Here is the program:
(*
https://discussions.apple.com/thread/3033221?tstart=30
Required:
Turn on accessability GUI in system preferences.
Optional:
--------
Full Key Codes
http://www.versiontracker.com/dyn/moreinfo/macosx/21215
youpi or iKey
youpi and iKey are keystroke remapping programs.
youpi, the free version, works fairly well for me in Mac OS 10.4 although not officially supported.
http://www.versiontracker.com/dyn/moreinfo/macosx/11485&vid=75326
iKey is the paid version
http://www.scriptsoftware.com/ikey/
*)
on run
-- Write a message into the event log.
-- To see, run this applescript in Sript Editor. Click on Event Log tab at bottom of screen.
-- Click run.
log " --- Starting on " & ((current date) as string) & " --- "
set fromApp to "Safari"
set toApp to "TextEdit"
--- We have arrived.
say "we are beginning now."
-- Start your application
tell application fromApp
activate
end tell
delay 1
say "copy data to clipboard"
tell application "System Events"
tell process fromApp
keystroke "c" using command down
delay 2
end tell
end tell
-- Start your application
tell application toApp
activate
end tell
delay 5
tell application "System Events"
tell process fromApp
-- open file menu
keystroke return
keystroke return
keystroke return
keystroke "v" using command down
end tell
end tell
say "good news, We are done."
end run
The first thing that you need to do is to make the text into an AppleScript program.
Start the AppleScript Editor
/Applications/AppleScript/Script Editor.app
In Snow Leopard it's at: /Applications/Utilities/AppleScript Editor
Copy the script text to the Applescript editor.
Save the text to a file as an application and do not check any of the boxes below.
If you want access to the script from your Script Menu, move the script (the saved script application file) to your
~/Library/Scripts folder. You can also drag it to your Dock or make an alias for it on the Desktop.<br><br>
To debug, run the script within the Applescript Editor. Click on the event log tab at the bottom of the window. Click on the run icon. The results from the log statement will be shown at the bottom of the screen.
---------------