Mavericks - UI Scripting from a Dashboard Widget (yikes!)

Howdy, faithful community! Many times in the past you all have put up with my arcane and difficult questions - so I appeal to you again.

As has been documented ( they changed how Access for Assistive Devices is enabled in OS X 10.9. It used to be global, but is now app-specific. This works fine for the applications you can register with it, but I’m getting stuck enabling it for widgets.

Here’s how the widget works:

  1. The widget makes a shell command call, via widget.system();
  2. The shell command runs a set Applescript script, via osascript.
  3. The applescript does work with System Events to copy or paste:
tell application "System Events"
		set UI_enabled to UI elements enabled
		if UI_enabled then
			set FrontApp to (name of (processes whose frontmost is true)) as text
			tell process FrontApp to click menu item "Copy" of menu 1 of menu bar item "Edit" of menu bar 1

  1. When the script exits, the widget knows that it know has clipboard contents to work with.

But, I’ve been unable to find the application to give permissions to so the widget can work. If you run the above script segment in the AppleScript Editor, it will only work if you give AppleScript Editor permission - as in, the calling application must have permission. But, I can’t figure out who the ‘calling application’ is for a widget! I’ve tried giving permissions to ‘System Events’, the Dashboard app, Terminal, and even and just in case, but to no avail.

Does anyone here have any ideas for what else to try? The old script that enables UI access:

 tell application "System Events" to set (UI elements enabled) to true

doesn’t work anymore in Maverick’s System Events.

 error "System Events got an error: Can't set UI elements enabled of application to true." number -10006 from UI elements enabled of application

Are there any ideas? I recognize this is potentially more of a dashboard question than an applescript question (I also posted a very similarly worded one on the Apple Communities), but since I’ve experienced such fantastic help here in the past, I thought I’d ask!

Thanks so much for reading.

I also would like to see a solution for this, for a widget that used UI scripting to paste content.
What must be allowed in the pref/permissions panel?