I have a problem with AppleScript and System Events.
I have check \"Enable access for assistive devices\" in the “Universal Access” preference pane in System Preferences
On Mac OS X 10.9 you actually get the same error when the AppleScript Editor is not allowed to use Accessibility.
Here's how you enable it:
Go to System Preferences > Security & Privacy > Privacy > Accessibility.
Then, just check the checkbox left to the AppleScript Editor and the error should be gone.