This is a very common question! And one that, fortunately, has many answers. Here are two solutions:
PreFab Player is an system extension which allows you to script the unscriptable… clicking buttons, checking checkboxes and radio buttons, deciding if dialog boxes are present, selecting items from menus…even in applications that do not have dictionaries of their own.
tell application "PreFab Playerââ??¢"
type return -- would hit the "OK" button in a dialog box, for example
end tell
QuicKeys is a macro utility that allows you to define shortcuts to do complex tasks in any application. The beauty of QuicKeys is that you can execute AppleScripts from within a QuicKeys sequence and, vice versa, AppleScript can call any previously defined QuicKey (via the scriptable QuicKeys Backgrounder application).