Can't run UI elements from script menu
I've got an Applescript that I'd like to run from Numbers using the Script Menu. The script requires UI elements in "System Events". The script runs properly when I run it from Script Editor, but when I select it in the Script Menu from Numbers it does nothing.
As a simple test, the following script displays "true" when run from Script Editor, but displays "false" when run from the Script Menu. I've discovered that I cannot simply set UI elements enabled to true, because it is a read only property.
tell application "System Events"
display dialog "UI elements enabled: " & (UI elements enabled) as text
end tell
I am running OS X version 10.11.4 on a 2015 Macbook Air.
MacBook Air, OS X El Capitan (10.11.4), AppleScript