Previous 1 2 Next 19 Replies Latest reply: Mar 31, 2015 12:21 PM by Hate when you ask for personal details
Nextyoyoma Level 1 (15 points)

So I have a launch-daemon that needs to utilize GUI scripting.  I need to be able to enable it through AppleScript (or really any scriptable, automated means).  I am trying to do this:


tell application "System Events" to if not UI elements enabled then

          set UI elements enabled to true

          return UI elements enabled

end if


but it doesn't seem to do anything.  The return query is just to check that it worked, but it never does.  I have tried saving the script and running it as administrator (sudo osascript myScript.scpt) but it still doesn't work.  I never get prompted for admin credentials.  This occurs when logged in as administrator or non-admin user.  Any ideas?

Previous 1 2 Next