Skip to content

Instantly share code, notes, and snippets.

@ludofleury
Last active August 2, 2022 15:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ludofleury/953baf680819a8fff6f5a1a1f5c07eec to your computer and use it in GitHub Desktop.
Save ludofleury/953baf680819a8fff6f5a1a1f5c07eec to your computer and use it in GitHub Desktop.
"automate my splitting of iterm windows and opening of docker-compose logs of my applications. You can use osascript to do that which will execute AppleScript" by Anne-Sophie (https://github.com/tanguy-a)
#!/bin/bash
osascript<<EOF
tell application "iTerm"
activate
select first window
# Create new tab
tell current window
create tab with default profile
end tell
# Split pane
tell current session of current window
split horizontally with default profile
end tell
# Run command in Pane-1
tell first session of current tab of current window
write text "ext"
write text "docker-compose -f docker-compose.yml -f titi.yml logs -f titi"
end tell
# Run command in Pane-2
tell second session of current tab of current window
write text "ext"
write text "docker-compose -f docker-compose.yml -f toto.yml logs -f toto"
end tell
end tell
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment