need iChat commands

I am trying to get a script that will try start a video chat with a specified buddy. Does anyone know what the scrpti is for this?

I can’t test it, but you can try this:

tell application "iChat"
	activate
	
	get first account of service "AIM" whose name is "Name as seen in buddy list"
	send video invite to result
end tell

Here is what I have so far. It is suppost to automatically close iChat if it does not connect. I have one problem. If the the person is not online, it will still try to connect. Is there a way that I can tell it not to send an inviation if the person is not online? The only tirck is everyone has a custom status bar that does not tell their status.

tell application "iChat"
	activate
	delay 5
	send video invitation to account "Andrew Warren"
	delay 5
	if status is not connected then
		close window "video chat with Andrew Warren"
		quit "iChat"		
	end if
end tell

Try this:

tell application "iChat"
	activate
	get first account of service "AIM" whose name is "Name as seen in buddy list"
	
	if (status of result) is not offline then send video invite to result
end tell

do you know how I can check the status of the video chat? The program connects to someone, reads this and closes ichat, I am not sure why

if status is not connected then
close window “video chat with Andrew Warren”
quit “iChat”
end if

Ive also tried
if status of video chat is not connected then

if video chat status is not connected then

I don’t think you can.

Ok, this works when they are online:
tell application “iChat”
activate
tell application “iChat”
activate
get first account of service “AIM” whose name is “adopps”

	if "adopps" is not offline then send video invitation to account "adopps"
else
    quit "iChat"
  end if

end tell
end tell

But, if they are not online and I run it, it still invites them to a video chat and shows an error. It sends and invatation if they are online or not. Is there anyway around this? When they are offline, they have no status message. Is there a way to say “if “user” has a status message, send video invatation” else, quite ichat? do the status messages have visible or true/false qualities? I thought:
If status message of account “adopps” is visible then semd invatation to video chat

Thanks for the help. It is a great site, and I will donate soon!

I was thinking, I could do the “get capabilities” command on the persons account. That will tell me if the person is capable of video chat, and if they are, the video icon is up and their account is active. Here is what I get if I do this:
ell application “iChat”
activate
get capabilities of account “andrew warren”
{video chat, multiperson video, audio chat, multiperson audio}
end tell

Is there a way to tell ichat to connect if “video chat” is a part of the capabilites found? That would be good.

Alright, here is the final solution.

tell application "iChat"
	activate
	delay 5
	set theStatus to get capabilities of account "josh metts"
	if theStatus contains video chat then
		send video invitation to account "Josh Metts"
	else
		quit "ichat"
	end if
end tell