Ive been working on a script to automatically rejoin Jabber based MUC rooms from messages. This script worked flawlessly up until trying on El Cap beta. After digging around and trying some very basic functions it appears that the scripting language for Messages is broken. Here is the code that currently works in Yosemite and not in El Cap.
repeat
with timeout of 3600 seconds
if application "Messages" is running then
tell application "System Events" to tell process "Messages"
with timeout of 3600 seconds
set AllWindows to name of every window
if (AllWindows contains "Verify Certificate") then
perform action "AXRaise" of (first window whose name contains "Verify Certificate")
click button "Continue" of group 2 of window "Verify Certificate"
display notification "I DID THE THING!" with title "Verify Certificate Alert Exterminated"
end if
end timeout
end tell
tell application "Messages"
with timeout of 3600 seconds
repeat with c in text chats
if connection status of service of c is connected and join state of c is not joined and (name of c ends with "@test.chatdomain.com" or name of c ends with "@test.chatdomaintwo.com") then
accept c
display notification "Jabber chatrooms have been rejoined" with title "I DID THE THING!"
end if
end repeat
end timeout
end tell
end if
delay 20
end timeout
end repeat
Other basic commands Ive tested are:
tell application "Messages"
accept text chat "test@test.im.com"
end tell
Ive replaced the specific group chat name in the above code for privacy reasons. The basic code returns an error:
"Messages got an error: text chat \"test@test.im.com\" doesn’t understand the “accept” message."
What am I missing here?