set theBundle to (path to library folder from system domain as text) & "PreferencePanes:Security.prefPane:"
set privacy_loc to localized string "CFBundleName" from table "InfoPlist" in bundle file theBundle --> "Sécurité et confidentialité"
tell application "System Preferences" to activate
delay 1
tell application id "com.apple.systemevents" to tell process "System Preferences"
set frontmost to true
tell menu bar 1
-- get name of menu bar items --> {"Apple", "Préférences Système", "Édition", "Présentation", "Fenêtre", "Aide"}
-- get name of menu bar item 4 --> "Présentation"
tell menu bar item 4 to tell menu 1
-- get name of menu items --> {"Précédent", "Suivant", "Afficher toutes les préférences", "Personnaliser…", missing value, "Classer par catégorie", "Classer par ordre alphabétique", "Rechercher", missing value, "Accessibilité", "App Store", "Bluetooth", "Bureau et économiseur d’écran", "CD et DVD", "Clavier", "Comptes Internet", "Contrôle parental", "Date et heure", "Démarrage", "Dock", "Économiseur d’énergie", "Extensions", "Flash Player", "Général", "iCloud", "Imprimantes et scanners", "Java", "Langue et région", "Mission Control", "Moniteurs", "Notifications", "Partage", "Réseau", "Sécurité et confidentialité", "Siri", "Son", "Souris", "Spotlight", "Time Machine", "Trackpad", "Utilisateurs et groupes", "Activer le mode plein écran"}
click menu item privacy_loc
end tell
end tell
repeat 20 times
if exists window privacy_loc then exit repeat
delay 0.1
end repeat
tell window privacy_loc
get class of UI elements --> {button, button, button, button, tab, button, button, button, toolbar}
tell tab group 1
--get class of UI elements --> {radio button, radio button, radio button, radio button, scroll area, group}
tell group 1
get class of UI elements --> {static text, scroll area, image, group} # Don't disable it
tell scroll area 1
-- get class of UI elements --> {table, scroll bar}
tell table 1
-- get class of UI elements --> {row, row, row, row, row, row, row, row, row, row, row, row, row, row, row, row, row, row, row, row, row, row, row, row, column}
set appsEnabled to {}
repeat with i from 1 to count rows
tell row i
-- get class of UI elements --> {UI element}
tell UI element 1
-- get class of UI elements --> {image, static text, checkbox, image, static text}
set end of appsEnabled to (name of static text 1)
end tell
end tell
end repeat
end tell
end tell
end tell
end tell
end tell
end tell
return appsEnabled