Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Watch or listen to your remote Mac with iChat AV' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Watch or listen to your remote Mac with iChat AV
Authored by: livi on Oct 09, '03 04:25:41PM

The error must be in this part of the script :
----
I recently found out about iCAR, which is an open-source project to add auto-reply abilities to iChat. You can use this to do any number of things -- respond with a static 'away' message, make a 'chatbot' that talks like Eliza the therapist, or control iTunes, an EyeTV, X10 devices if you have those.

I realized that I could use this to create an instant audio or video "room monitor," allowing me to quickly check on things at home. iCAR can't yet auto-accept your invitation to an AV chat, so instead, we'll have the listening Mac invite you to an AV chat when you ask it to.
To do this, you'll need:

1. Two Macs, both running iChat AV. I'll call one the 'listening Mac', and the other 'your Mac.'
2. One AIM/.Mac account for yourself, and a different one for the listening Mac. You can grab one at http://aim.com.
3. The listening Mac can use its built-in microphone, or a microphone, webcam, or Firewire digicam.

[robg adds: I haven't tested this one out yet, but I intend to -- it seems very very useful!]
To make your 'iChat room monitor,' do this:

1. Download iCAR on the listening Mac.
2. Download this Perl script, or copy-and-paste from the end of this hint. Remember you need to make the script executable (chmod a+x /path/to/iChatGreet.pl) if you copy-paste.
3. In iChat on the listening computer, add yourself to the buddy list. The script will only initiate an AV chat with someone on the listening computer's buddy list.
4. Open iChat preferences, and under 'Auto-Reply', select the script as a Unix command source.
When you want to watch or listen to the listening Mac, just start a regular text chat with your listening Mac. If you type 'listen', it will invite you to an audio chat; if you type 'watch', it will invite you to a video chat.

That's it! The script is just a stub -- feel free to post other ideas in the comments.
Script:


#!/usr/bin/perl

###############################################
# Settings

###############################################
# Setup
$screen_name = $ENV{'iCAR_screenname'};
$real_name = $ENV{'iCAR_name'};
$received_message = $ENV{'iCAR_message'};

$time_of_day = get_time_of_day();

## debugging:
#$screen_name = "myhandle";
#$received_message = "listen";

###############################################
# Main response
if ($received_message =~ /listen/)
{
start_media_chat($screen_name,"audio");
}
elsif ($received_message =~ /watch/)
{
start_media_chat($screen_name,"video");
}
else
{
# joe public
print "Good $time_of_day, $real_name.";
}
exit;

###############################################
# subroutines

sub start_media_chat($$)
{
my ($screen_name_to_invite,$media_type) = @_;
print "Starting $media_type chat...\r\n";
close STDOUT;
my $script = media_chat_script($screen_name_to_invite,$media_type);
system("osascript -e '" . $script . "' &");
}

sub media_chat_script($$)
{
my ($screen_name_to_invite,$media_type) = @_;
return <<EOS;
tell application "iChat"
repeat with a in (every account where handle is "$screen_name_to_invite")
send $media_type invitation to a
end repeat
end tell
EOS
}
----


If I try to run the script in terminal I see the following error :

maccie% ./ichatgreet.pl
Bareword found where operator expected at ./ichatgreet.pl line 58, near "EOS"
(Might be a runaway multi-line << string starting on line 50)
syntax error at ./ichatgreet.pl line 58, near "EOS"
Missing right curly or square bracket at ./ichatgreet.pl line 74, at end of line
syntax error at ./ichatgreet.pl line 74, at EOF
Execution of ./ichatgreet.pl aborted due to compilation errors.



[ Reply to This | # ]
Watch or listen to your remote Mac with iChat AV
Authored by: nikitab on Oct 09, '03 05:26:31PM
You should fix the script so that the line that has 'EOS' just by itself (after 'end tell') has no white space in front of it. The indentation is causing the problems. I.e.:
   ...
     end repeat
   end tell
EOS
}


[ Reply to This | # ]
Watch or listen to your remote Mac with iChat AV
Authored by: livi on Oct 10, '03 07:17:06AM

Yep.... it works fine now !

This is a great application for monitoring your computer or room...



[ Reply to This | # ]
Watch or listen to your remote Mac with iChat AV
Authored by: AaronS on Oct 12, '03 09:04:05PM

It didn't seem to fix the problem for me. All that happens after I choose the perl script and then IM the "listening" computer is a spit out of the computers uptime, which appears to be the original script that was entered...

Any other ideas?



[ Reply to This | # ]
Watch or listen to your remote Mac with iChat AV
Authored by: dcottle on Oct 13, '03 01:11:04AM

I just stumbled onto this thread and it looks like something I could use. I record concerts in a music building and we have several venues. I've been thinking of linking them over ethernet. But is the sample and bit rate high enough? I imagine iChat is pretty low, or is it?



[ Reply to This | # ]
Watch or listen to your remote Mac with iChat AV
Authored by: mithras on Oct 13, '03 03:54:57PM

Try typing the path to the script instead of using the "Select" button, or try selecting it and then quitting right away... iCAR seems to be finicky about this.

---
--
Listen To My iTunes Library (6500+ songs, iTunes 4 required)



[ Reply to This | # ]