Enable/disable the okay button based on the presence of text in the To: field for...
[adiumx.git] / ASUnitTests / CreateChat.applescript
blob477ce20bc859f842588198b90e32214b35616bce
1 global HandyAdiumScripts
3 on run
4 tell application "Adium"
5 set c to count chat windows
6 set c2 to count chats
7 tell account (HandyAdiumScripts's defaultAccount)
8 set newChat to make new chat with contacts {contact (HandyAdiumScripts's defaultParticipant)} with new chat window
9 set newChatWindow to (get window of newChat)
10 if (count chat windows of application "Adium") is not c + 1 then
11 close newChatWindow --restore
12 error
13 end
14 if (count chats of application "Adium") is not c2 + 1 then
15 close newChatWindow --restore
16 error
17 end
18 if (count chats of newChatWindow) is not 1 then
19 close newChatWindow --restore
20 error
21 end
22 set newChat2 to make new chat with contacts {contact (HandyAdiumScripts's otherParticipant)} at end of chats of newChatWindow
23 if (count chat windows of application "Adium") is not c + 1 then
24 close newChatWindow
25 error
26 end
27 if (count chats of application "Adium") is not c2 + 2 then
28 close newChatWindow
29 error
30 end
31 if (count chats of newChatWindow) is not 2 then
32 close newChatWindow
33 error
34 end
35 close newChatWindow
36 end tell
37 end tell
38 end run