iChat autoaccept with conditional statement

I tried to write a script that would allow me to auto accept a video invite if the screen name handle begins with “marv”. It doesn’t seem to work right on my iChat, generating an error:

Error: Can’t get buddy id “31A52166-7297-…:marv2” whose handle starts with “marv”.

What am I missing?

Here’s the code:

using terms from application “iChat”
on received video invitation theVideo from theBuddy for theChat
if (theBuddy whose handle begins with “marv”) then
accept theChat
end if
end received video invitation
end using terms from

Hi,

theBuddy is not a list, therefore the whose filter doesn’t work.
Try this


using terms from application "iChat"
	on received video invitation theVideo from theBuddy for theChat
		if handle of theBuddy begins with "marv" then
			accept theChat
		end if
	end received video invitation
end using terms from