Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. -- Save me in ~/Library/Application Support/iTerm2/Scripts, then restart iTerm2 and find me in the Scripts menu
  2. set hostnames to {"foo1.bar.baz", "foo2.bar.baz", "foo3.bar.baz", "foo4.bar.baz", "foo5.bar.baz", "foo6.bar.baz"}
  3.  
  4. tell application "iTerm"
  5. activate
  6. create window with default profile
  7. tell current tab of current window
  8. select
  9. tell current session
  10. write text "ssh " & (item 1 of hostnames)
  11. set lower to split horizontally with default profile
  12. set num_hosts to count of hostnames
  13. repeat with n from 2 to num_hosts
  14. if n - 1 is (round (num_hosts / 2)) then
  15. select lower
  16. write text "ssh " & (item n of hostnames)
  17. else if n > 1 then
  18. set new_split to split vertically with default profile
  19. tell new_split
  20. write text "ssh " & (item n of hostnames)
  21. end tell
  22. end if
  23. end repeat
  24. end tell
  25. end tell
  26. end tell
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement