mingsai

Enable GUI Scripting

Mar 1st, 2014
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if enabledGUISCripting(true) then
  2.     -- GUI Scripting statements go here
  3.     display dialog "GUI Scripting is enabled"
  4. else
  5.     --non-GUI scripting statements go here
  6.     display dialog "GUI Scripting is disabled"
  7. end if
  8.  
  9. on enabledGUISCripting(switch)
  10.     tell application "System Events"
  11.         activate
  12.         if not (UI elements enabled) then set (UI elements enabled) to true
  13.         return (UI elements enabled)
  14.     end tell
  15. end enabledGUISCripting
Advertisement
Add Comment
Please, Sign In to add comment