macOS-assessment-toggle/assessment-toggle.applescript

13 lines
457 B
AppleScript
Raw Normal View History

2022-11-14 19:36:22 +00:00
try
do shell script "spctl --status"
do shell script "spctl --master-disable" with administrator privileges
display dialog "Assessment disabled!" buttons {"OK"} default button 1
on error
try
do shell script "spctl --status"
display dialog "Error!" buttons {"OK"} default button 1
on error
do shell script "spctl --master-enable" with administrator privileges
display dialog "Assessment enabled!" buttons {"OK"} default button 1
end try
end try