Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Applescript question

hey everyone,

i just started learning applescript yesterday, so bear with me.

I wanted to write a script for iChat which opens an IM window every time a specific buddy signs on.

Here is my script:

tell application "iChat"
if (buddy became available "hetu1989") then
show chat chooser for "hetu1989"
end if
end tell


When my screen name "hetu1989" signs on, my iChat gives me the following error:

User uploaded file

I tried to find out how to get rid of this error, but I can't find anything about it. Any help will be appreciated.

Thanks a lot!

Message was edited by: iamhetu

Mac OS X (10.6.2)

Posted on Feb 24, 2010 7:38 AM

Reply
6 replies

Feb 25, 2010 1:05 PM in response to iamhetu

Hi,

Niel knows more about AppleScript than I do.

I have these two AppleScripts to Change the Status Message on Started Video and End of Video Chats

Script 1

using terms from application "iChat"

on av chat started
set status to away
set status message to "In Conference . . ."
end av chat started
end using terms from


and

using terms from application "iChat"

on av chat ended
set status to available
set status message to "I was Busy but Now I am Not"
end av chat ended
end using terms from


If I change the Status message in between the two actions then I get the same Error.

I would normally say it happens if I set the Message to an Available one and the Script "Protests" because the Status is already Available.

From this I would wonder if the Script is aimed working when he shows up as On-line from being Off-line and you are testing when he is already On-Line ?

I hope this throws some light.

User uploaded file

9:05 PM Thursday; February 25, 2010

Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"

Feb 26, 2010 9:43 PM in response to iamhetu

ahh, i got it.

set hetu1989 to buddy(AIM, hetu1989)

using terms from application "iChat"
on buddy became available hetu1989
show chat chooser for hetu1989
end buddy became available
end using terms from


using terms from application "iChat"
on buddy became unavailable
close (show chat chooser hetu1989)
end buddy became unavailable
end using terms from

Thanks a lot everyone.

By the way, is there a way to automatically make it accept the chat chooser? I couldn't find anything in the dictionary for it.

Feb 27, 2010 1:45 PM in response to iamhetu

Hi,

Good to hear.

On the Auto Accept. That is built in ichat already and you can set it for Individual Buddies
Click on the Buddy to Highlight
Use th Get Info Keys (Apple and I together) (Or Right click and chose the Info Card from the menu)
In the Info Card go to Alerts
Select the required Incoming Invite option in the top drop down.
Set the AppleScript to Auto Select. (it's a bunch of If statements that accept any Invite depending on the Alert setting modifying it)

User uploaded file

9:45 PM Saturday; February 27, 2010

Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"

Applescript question

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.