0

I am using Keyboard Maestro and within that using applescript for following action:

  • Copy IP address from anywhere
  • Open terminal
  • Use copied IP into applescript
  • ssh on IP which was copied from somewhere

    tell application "Terminal"
    activate
    do script "ssh & the clipboard" -- this always opens a new window
    

    end tell

Kindly help me with the solution on how I can use "copied" text within applescript to do ssh, as I dont want to write direct IP within script

Vipin Choudhary
  • 331
  • 1
  • 2
  • 16
  • 1
    What is the question? – vadian Apr 17 '18 at 16:52
  • I want to automate SSH command. Copy IP address, press Keycombination (Control+Shift+T on mac) and it should open terminal, type ssh user@copied_ip and password. Previously I was using AutoHot key which does this but AutoHot key doesnt work on MAC, so looking for alternatives – Vipin Choudhary Apr 18 '18 at 02:38
  • It's still unclear what you are asking. What does *fixing this* mean? – vadian Apr 18 '18 at 03:50
  • I have edited the post.. and now looking for help in solution - not fixing.. – Vipin Choudhary Apr 18 '18 at 04:22

1 Answers1

0

ok got the answer

set ipaddress to the clipboard  tell application "Terminal"     
activate     
do script "ssh " & ipaddress & " " -- this always opens a
new window end tell
Vipin Choudhary
  • 331
  • 1
  • 2
  • 16