Skip to content

Instantly share code, notes, and snippets.

@botanicus
Last active September 2, 2018 15:34

Revisions

  1. James C Russell revised this gist May 30, 2014. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions PPT.applescript
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    -- Find more at http://iterm.sourceforge.net/scripting.shtml

    launch "iTerm"

    tell application "iTerm"
  2. James C Russell created this gist May 30, 2014.
    35 changes: 35 additions & 0 deletions PPT.applescript
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,35 @@
    launch "iTerm"

    tell application "iTerm"
    activate

    -- ssh in split panes to my varnish stack
    set myterm to (make new terminal)
    tell myterm
    -- Use PPT *profile*
    launch session "PPT"
    -- Split window #1.
    tell the last session to write text "cd ~/Dropbox/Projects/PPT/source"
    tell the last session to write text "vagrant up"
    delay 1
    tell i term application "System Events" to keystroke "k" using command down

    -- Split window #2.
    tell i term application "System Events" to keystroke "d" using command down
    delay 2 -- Otherwise last session is not the new one, but rather the first one.
    -- Also, the the CWD would be the default rather than the one of the last session.
    tell the last session to write text "vagrant ssh"

    -- Split window #3.
    tell i term application "System Events" to keystroke "D" using command down
    tell the last session to write text "vagrant ssh"
    end tell

    end tell

    -- Fullscreen.
    set bid to id of application "iTerm"

    tell application "System Events" to tell (process 1 where bundle identifier is bid)
    click (button 1 of window 1 where subrole is "AXFullScreenButton")
    end tell