Hello,
Im trying to work out how to open a blank chat with a contact in ichat.
So far all i know is how to send a message via applescript but i dont want to do that.
i just want a chat window with the person.
Ive seen it done in widgets but using cocoa plugins but i suspect they are just calling applescripts from cocoa like ive done before
If you want to get technical and have your voice recognization turned on…tell your computer to “call friend”. It will ask you which friend to call. Tell it the friends name as seen in the buddy list. It will invite them to an audio conversation. If you change the script, it can be a video chat. When you are done say “quit ichat”. Hope this helps.
tell application "SpeechRecognitionServer"
activate
try
set heardPhrase to listen for {"call friend", "quit ichat"} giving up after 2 * days
on error -- time out
return
end try
end tell
if heardPhrase is "call friend" then
delay 1
say "which friend do you want to call" using "Victoria"
tell application "SpeechRecognitionServer"
activate
tell application "iChat"
activate
delay 2
get name of accounts
set nameAccounts to name of accounts
end tell
try
set heardFriend to listen for nameAccounts giving up after 2 * days
on error -- timed out
return
end try
end tell
tell application "iChat"
activate
set theStatus to get capabilities of account heardFriend
if theStatus contains audio chat then
send audio invitation to account heardFriend
set visible of window 1 to false
else
quit "ichat"
end if
end tell
else if heardPhrase is "quit ichat" then
tell application "iChat"
repeat until number of windows is 3
tell window 1 to close
end repeat
quit "ichat"
end tell
end if