applescriptmacos-mojavesystem-preferences

Apple script to bring System Preferences pane to front


I am trying to navigate to security pane in system preferences using below script, if pane is already opened and minimised, script is not able to bring it front. Is there a way along with activation , I can bring it to front

tell application "System Preferences"
     activate
     set current pane to pane "com.apple.preference.security"
end tell

Solution

  • This script checks the state of the window.