AppleScript UI Scripting (For Mac OS X 10.3+)

UI scripting gives applescript the ability to operate gui elements (menus,check boxes, pop up menus, buttons, radio buttons) of the system or application windows and dialogs. It makes it possible to use applescript alone to automate what would normally be user actions like choosing menus, clicking buttons and typing in text boxes of various dialogs.

Enabling APPLESCRIPT to access menu and dialog elements:

Check "Enable access for assistive devices" in System Preference Pane "Universal Access"
See red circle below.