Applescript able to click OK buttons ?

I’m new to Applescript and want to open a bunch of files. Upon opening a file, I’m presented with two consecutive dialog boxes, where I simply press Return to take the default response.

I can go into the Record mode of Applescript, step thru my actions, and it builds the appropriate code for opening the file.

However it does not build any code to press the default buttons, even though I pressed those buttons while in Record mode.

Is Applescript capable of pressing buttons ?

Can somebody give me a clue or two about this.

Thank you.


p.s. I’m on Mac OS X 10.4.2.

Not enough info.

For a start, what app are you dealing with?

It’s usually a bad idea to try to get AppleScript to do things the way you’d do things manually (e.g. click a button). It’s often better, if possible, to write the script to do what you want.

You should check the application’s dictionary to see what options (if any) is has for the open command. For example, say the dialog in question asks if you want to convert the document in some way. You might find that the dictionary has an optional ‘conversion true/false’ parameter, in which case you’d change the script to say:

open thefile with conversion


open thefile without conversion

depending on whether you wanted the true or false option.


Thank you for your answers and questions.

I’m working with FileMaker Pro 7, and I want to automatically convert a folder full of FM Pro 4 files.

I can do this manually, by dragging a FM Pro 4 file onto the FM Pro 7 application.

It says something about needing to convert it, then I click the OK button.

It then throws up a second dialog box, which I also take the default to. I think this is a Save dialog box.

I checked the FM Pro 7 dictionary, and see an Open command in the Subset of Core, Table and Database. But no sub-option to convert while opening.

Assuming I’m looking in the right place, that seems to rule out using a Open With Conversion option.

I’m open to suggestions on how to automate this task.

Thank you.