This is maybe not the best approach…
But I like to show a different way to open System Preference Pane.
The extension ‘prefPane’ is default open with ‘System Preferences’ so we only need to
set the path and use open command.
set thePathPref to (path to library folder from system domain as text) & "PreferencePanes:"
tell application "System Preferences"
open thePathPref & "Accounts.prefPane"
end tell
tell application "System Preferences"
open thePathPref & "Appearance.prefPane"
end tell
tell application "System Preferences"
open thePathPref & "Bluetooth.prefPane"
end tell
tell application "System Preferences"
open thePathPref & "DateAndTime.prefPane"
end tell
tell application "System Preferences"
open thePathPref & "DesktopScreenEffectsPref.prefPane"
end tell
(*
tell application "System Preferences"
open thePathPref & "DidHubDiscs.prefPane"
end tell
*)
tell application "System Preferences"
open thePathPref & "Displays.prefPane"
end tell
tell application "System Preferences"
open thePathPref & "Dock.prefPane"
end tell
tell application "System Preferences"
open thePathPref & "EnergySaver.prefPane"
end tell
tell application "System Preferences"
open thePathPref & "Expose.prefPane"
end tell
tell application "System Preferences"
open thePathPref & "Extensions.prefPane"
end tell
(*
tell application "System Preferences"
open thePathPref & "FibreChannel.prefPane"
end tell
*)
tell application "System Preferences"
open thePathPref & "iCloudPref.prefPane"
end tell
(*
tell application "System Preferences"
open thePathPref & "Ink.prefPane"
end tell
*)
tell application "System Preferences"
open thePathPref & "InternetAccounts.prefPane"
end tell
tell application "System Preferences"
open thePathPref & "Keyboard.prefPane"
end tell
tell application "System Preferences"
open thePathPref & "Localization.prefPane"
end tell
tell application "System Preferences"
open thePathPref & "Mouse.prefPane"
end tell
tell application "System Preferences"
open thePathPref & "Network.prefPane"
end tell
tell application "System Preferences"
open thePathPref & "Notification.prefPane"
end tell
tell application "System Preferences"
open thePathPref & "ParentalControls.prefPane"
end tell
tell application "System Preferences"
open thePathPref & "PrintAndScan.prefPane"
end tell
tell application "System Preferences"
open thePathPref & "Profiles.prefPane"
end tell
tell application "System Preferences"
open thePathPref & "Security.prefPane"
end tell
tell application "System Preferences"
open thePathPref & "SharingPref.prefPane"
end tell
tell application "System Preferences"
open thePathPref & "SoftwareUpdate.prefPane"
end tell
tell application "System Preferences"
open thePathPref & "Sound.prefPane"
end tell
tell application "System Preferences"
open thePathPref & "Speech.prefPane"
end tell
tell application "System Preferences"
open thePathPref & "Spotlight.prefPane"
end tell
tell application "System Preferences"
open thePathPref & "StartupDisk.prefPane"
end tell
tell application "System Preferences"
open thePathPref & "TimeMachine.prefPane"
end tell
(*
tell application "System Preferences"
open thePathPref & "TouchID.prefPane"
end tell
*)
tell application "System Preferences"
open thePathPref & "Trackpad.prefPane"
end tell
tell application "System Preferences"
open thePathPref & "UniversalAccessPref.prefPane"
end tell
(*
tell application "System Preferences"
open thePathPref & "Wallet.prefPane"
end tell
*)