Opening a VNC connection over SSH

tell application "System Events" 
    tell application "iTerm" 
        activate
        set myterm to (make new terminal)
        tell myterm
            set mysession to (make new session at the end of sessions)
            tell mysession
                set foreground color to "yellow" 
                set background color to "blue" 
                set transparency to "0.3" 
                exec command " ssh -L5901:127.0.0.1:5900 you@othermachine" 
            end tell
        end tell
        set the bounds of the first window to {750, 0, 1280, 200}
        set the name of the first window to "VNC" 
    end tell

    delay 2 --wait for connection
    tell application "Chicken of the VNC" to activate
    key code 36 --press enter

end tell

admin