I’m running the script below and getting unexpected results (see the comments in the script itself). Can others confirm this wonkiness? Any suggestions for getting the expected results?
--Mac OS X 10.6.8 (10K540)
--iChat Version 5.0.3 (745)
--AppleScript 2.1.2
tell application "iChat"
get status message
--> ""
get status
--> available
set status to away
set status message to "On the phone..."
get status message
--> "" [while iChat says the status message is "", it is updated to "On the phone..." per the request]
get status
--> available [this should be away]
delay 10
set status message to ""
set status to available
get status message
--> "" [while iChat says the status message is "", it is still "On the phone..." from the earlier request]
get status
--> available
end tell
for me it works reliably when setting the status always first and adding some short delays
tell application "iChat"
get status message
--> ""
get status
--> available
set status to away
delay 0.2
set status message to "On the phone..."
delay 0.2
get status message
--> "" [while iChat says the status message is "", it is updated to "On the phone..." per the request]
get status
--> available [this should be away]
delay 10
set status to available
delay 0.2
set status message to ""
delay 0.2
get status message
--> "" [while iChat says the status message is "", it is still "On the phone..." from the earlier request]
get status
--> available
end tell
Great, that helped. Thank you. The script now performs as expected:
--Mac OS X 10.6.8 (10K540)
--iChat Version 5.0.3 (745)
--AppleScript 2.1.2
tell application "iChat"
get status message
--> ""
get status
--> available
set status to away
delay 0.2
set status message to "On the phone..."
delay 0.2
get status message
--> "On the phone..." [true]
get status
--> away [true]
delay 10
set status to available
delay 0.2
set status message to ""
delay 0.2
get status message
--> "" [true]
get status
--> available [true]
end tell