Skip to content

Instantly share code, notes, and snippets.

@mdigan
Last active February 23, 2018 07:32
Show Gist options
  • Select an option

  • Save mdigan/6510737 to your computer and use it in GitHub Desktop.

Select an option

Save mdigan/6510737 to your computer and use it in GitHub Desktop.
Create a new iterm tab with a random background color
tell application "iTerm"
activate
tell the first terminal
set mysession to (make new session at the end of sessions)
-- talk to the session
tell mysession
set red to random number 65535
set green to random number 65535
set blue to random number 65535
-- set some attributes
set name to "new"
set background color to {red, green, blue}
exec command "/bin/bash"
end tell
end tell
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment