This should be ele-MENTAL!! Please help.

Is it possible that no such thing exists? Using OS X 3.9 I’m trying to ‘dismiss’ or click the ‘OK’ button on a dialog box that pops when trying to use a script I’ve used in OS9 for years to enter an AIM community chat room. In OS9 it didn’t ask, it just opened the chatroom. This is the script:

tell application “AOL Instant Messenger (SM)”
activate
GetURL “aim:GoChat?RoomName=Sex+and+the+City&Exchange=5”
end tell

Anybody know if there’s anything I can add to suppress the dialog or pick “OK”? I’ve already tried the keyboard commands in Extra Suites and they sort of work in this convoluted script unless other thing are happening on my screen:

tell application “AOL Instant Messenger (SM)”
activate
tell application “Extra Suites”
ES type key “return”
end tell
GetURL “aim:GoChat?RoomName=Sex+and+the+City&Exchange=5”
end tell

I’ve looked and looked and have found no answer to dismissing dialog boxes.
Thanks

Have you tried this? I’ve always used ichat. Your not using that?


    
    tell app "system events" to tell preocess "AOL Instant Messenger (SM)"
activate
repeat until exists process "AOL Instant Messenger (SM)"
delay .5
end repeat
set frontmost to true
keystroke return
end tell
tell app      "AOL Instant Messenger (SM)"
GetURL "aim:GoChat?RoomName=Sex+and+the+City&Exchange=5"
end tell

if i’m not mistaking GUI scripting is available through “system events” since 10.3. you may have to enable it in “universal access” preference pane.
try this:


tell application "System Events"
	activate
	tell application process "AOL Instant Messenger (SM)"
		set frontmost to true
		keystroke "return" --or "enter"
	end tell
end tell
-- the rest of your script

Thanks, I havent gotten around to ICHAT yet. When I looked at it I saw no community chats.
Thanks alot for the suggestions but neither worked for me. Bonedocs script wouldn’tgo past the first quotation marks in before AOL INTANT… giving me the error "Expected end of line but found “.”
With Noiroi’s it compiled but gave me the error on runnin “System Events got an error: NSReceiverEvaluationScriptError: 4”

???I’m stumped

Sorry, I had some typos…Try this. If it does not work, I am not sure what will. I have never used the app you are talking about, or the command that you are giving it.

tell application  "system events" to tell process "AOL Instant Messenger (SM)"
	activate
	delay 3
	set frontmost to true
	keystroke return
end tell
tell application  "AOL Instant Messenger (SM)"
GetURL "aim:GoChat?RoomName=Sex+and+the+City&Exchange=5"
end tell

EUREKA!! Thanks Bonedoc…that works! I REALLY appreciate it.