main
#! /usr/bin/env osascript if [[ "$(uname -s)" != 'Darwin' ]]; then echo 'Sorry, this script only works on macOS' exit 1 fi tell app "iTerm2" to tell current session of first window contents end tell