#!/usr/bin/perl -w
use strict; $|++;
use Mac::Glue;
use warnings;
#
# This script sends a text file, one line at a time, to one of your aim
# contacts on iChat. the person must be in your contact list and must be
# online. it's called like this:
# /path/to/script.pl aimcontact < text_file
#
# written to send the holy grail script to my friend dan.
#
my $ichat = new Mac::Glue "iChat";
my $aimuser = shift or die "usage: $0 aim_user_to_bug < textfile \n";
my $account = $ichat->obj(account => $aimuser);
die "can't find $aimuser\n" unless ( $account->prop("status")->get and
($account->prop("status")->get ne "offline"));
for (my $i=1; <> ; $i++) {
chomp; chomp; chomp;
$ichat->send($_, to => $account);
if ( ($i % 4) == 0 ) { sleep 20; }
else { sleep 5; }
}
syntax highlighted by Code2HTML, v. 0.9.1