display dialog "Please select action to perform." buttons {"Lock", "Unlock", "Reset"} with title "macOS Dock Manager"
set the button_pressed to the button returned of the result
if the button_pressed is "Lock" then
display dialog "Lock Dock..." buttons {"Position", "Size", "Contents"} with title "macOS Dock Manager"
set the button_pressed to the button returned of the result
if the button_pressed is "Position" then
do shell script "defaults write com.apple.Dock position-immutable -bool yes;killall Dock"
else if the button_pressed is "Size" then
do shell script "defaults write com.apple.Dock size-immutable -bool yes;killall Dock"
else
do shell script "defaults write com.apple.Dock contents-immutable -bool yes;killall Dock"
end if
else if the button_pressed is "Unlock" then
display dialog "Unlock Dock..." buttons {"Position", "Size", "Contents"} with title "macOS Dock Manager"
set the button_pressed to the button returned of the result
if the button_pressed is "Position" then
do shell script "defaults write com.apple.Dock position-immutable -bool no;killall Dock"
else if the button_pressed is "Size" then
do shell script "defaults write com.apple.Dock size-immutable -bool no;killall Dock"
else
do shell script "defaults write com.apple.Dock contents-immutable -bool no;killall Dock"
end if
else
display dialog "Reset Dock to factory settings." buttons {"Reset", "Cancel"} with title "macOS Dock Manager"
if the button returned of the result is "Reset" then
do shell script "defaults delete com.apple.dock;killall Dock"
end if
end if
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.