User:Macowell/iChat Autoconnect

From 2007.igem.org

Download here: SynBERC iChat Auto-connect applescript

Program Overview

This is an applescript intended to automatically establish a full-screen iChatAV connection between two computers. This is the basic program flow:

  1. Set a hidden system preference that tells iChat to automatically accept incoming chat invitations (com.apple.ichat AutoAcceptVCInvitations 1)
  2. Log iChat in (Starting it if is not running)
  3. Set the status message to "autoconnect"
  4. Loop indefinitely, trying every 30 seconds to:
    1. log in (in case the connection gets messed up)
    2. check if the status message is "autoconnect, and if so, invite the specified user to a video chat (for us, either 'SynBERC MIT' or 'SynBERC Berkeley'). This allows users to control the script by changing the status message, instead of stopping it / restarting it.
    3. enter fullscreen mode (should be the video chat window, but this code isn't specific and might make any chat fullscreen, not sure)

Installation & Usage

  1. download it and store it someplace appropriate like your user's home directory.
  2. open it using the pre-installed script editor (just use spotlight to find it by typing apple-space + 'script editor'
  3. change the specified user if necessary (defaults to connect to 'SynBERC MIT')
  4. set the script to run every time the default user logs in: open system preferences -> accounts -> login items and add the script to the list.

Remember, the script will start iChat and set the status to 'autoconnect' every time it runs, and will try to initiate a videochat every ~36 seconds unless the status is changed from 'autoconnect'.

Macowell 18:24, 7 August 2007 (EDT)