0 Replies Latest reply: May 16, 2009 4:23 AM by Rob Bally
Rob Bally Level 1 Level 1 (45 points)
I made a script to close all iChat erorrs. It works fine when started as stand alone script, however when inserted in "auto accept.applescript" in event "on AV Chat ended" is does not work, It seems the number of ichat windows is zero.

Any suggestion?

tell application "System Events"
-- get rid of every possible error
display dialog "number of windows : " & (count of windows of application process "iChat") as text
repeat with myWindow in windows of application process "iChat"
-- display dialog "windownaam" & title of myWindow as text
repeat with myButton in buttons of myWindow
set myButtonTitle to title of myButton as text
if myButtonTitle is "OK" then click myButton
if myButtonTitle is "Don’t Send" then click myButton
end repeat
end repeat

repeat with myWindow in windows of application process "iChat"
repeat with mySheet in sheets of myWindow
repeat with myButton in buttons of mySheet
set myButtonTitle to title of myButton as text
if myButtonTitle is "OK" then click myButton
if myButtonTitle is "Don’t Send" then click myButton
end repeat
end repeat
end repeat

try
click button "OK" of window 1 of application process "UserNotificationCenter"
end try

end tell --"System Events"

Mac Pro, Mac OS X (10.5.7), speedtouch ST780 uPnP enabled