Home > CCIE, CCIE Labs, Code, Routing > TestLab Script in AppleScript

TestLab Script in AppleScript

August 14th, 2011 Leave a comment Go to comments

I got a new Mac Pro workstation at work and re-wrote some scripts to work on it. This morning I couldn’t find the script under the new file lay out, it was in /Applications so I decided I had better document the script so I don’t have to rewrite it if I can’t find it.

It uses the same script, tle, that I wrote a while ago, it just fires up iTerm instead of Gnome Terminal.

-- 2011-03-24
-- Jud Bishop


tell application "iTerm"
    activate
   
    -- If you don't have this you end up with two terminals
    terminate the first session of the first terminal
   
    set iterm to (make new terminal)
   
    repeat with X from 1 to 6
        set Y to "R" & X as string
        tell iterm
            make new session at the end of sessions
            tell the last session
                exec command "/usr/local/bin/tle " & Y & " testlab.chainringcircus.org"
                set name to Y
            end tell
        end tell
    end repeat
   
   
    repeat with X from 1 to 4
        set Y to "SW" & X as string
        tell iterm
            make new session at the end of sessions
            tell the last session
                exec command "/usr/local/bin/tle " & Y & " testlab.chainringcircus.org"
                set name to Y
            end tell
        end tell
    end repeat
   
    repeat with X from 1 to 3
        set Y to "BB" & X as string
        tell iterm
            make new session at the end of sessions
            tell the last session
                exec command "/usr/local/bin/tle " & Y & " testlab.chainringcircus.org"
                set name to Y
            end tell
        end tell
    end repeat
   
    set the bounds of the first window to {0, 0, 1200, 900}
   
end tell
Categories: CCIE, CCIE Labs, Code, Routing Tags:
  1. No comments yet.
  1. No trackbacks yet.