Clicking OK in response to an error.

Okay, I generated an ‘error’ in filemaker, and I want to automate clicking “OK”.
For anyone who wants to attempt to replicate the test, open filemaker pro (I’m using 10v3) and click so no fields are selected, then try and type a or something. You’ll get a “Before typing, press Tab…” etc error.
System Events works, as I have turned on universal access.

At the moment, I’ve tried:

tell application "System Events"
	tell process "FileMaker Pro"
		click button "OK" of front window
	end tell
end tell

However, it doesn’t appear that the error is regarded as a window. If I try and get the name of the front window, it times out while waiting for FMP. If I run the above script, it doesn’t do anything.

In Applescript you can create a dialog, surely you can interact with one?
How can I tell Applescript to tell filemaker to click okay, if an error dialog appears?

Hi TinBane

have you tried using Accessibility Inspector to get the name of the window, youll need to down load
Developer Tools.

http://developer.apple.com/Mac/library/documentation/Accessibility/Conceptual/AccessibilityMacOSX/OSXAXTesting/OSXAXTestingApps.html

Macintosh HD:Developer:Applications:Utilities:Accessibility Tools:Accessibility Inspector.app:

once you have the name of the window you could try something like this maybe

click button “OK” of window “name of your window here”

or maybe a simple “keystroke return” might do the trick

Budgie

It appears the window doesn’t have a name.
Which is weird.
It’s a window, it’s parent is a window, but it doesn’t have a window name.
It’s role is window
it’s description is “dialog”
It’s subrole is “Dialog”
It has 3 children.
Main is true

And it’s default button is the Button “OK”

Hmm, so should I try calling window 1 or something?

Yes it does. Is there a way to simulate an enter press?

as I posted earlier

or maybe a simple “keystroke return” might do the trick

Thanks guys, I’ll give it a shot!