- Launch the Automator
- Choose a type as Application for your documents
- Find Actions, 'Run AppleScript'
- Type the AppleScript
- Save the action in the Application folder
Optional Steps:
- Add your own icon
- Keep in dock
- todarkmode: CLI switcher to dark mode on macOS Mojave
Choose Application type
Find Actions 'Run AppleScript'
AppleScript Code:
tell application "System Events"
tell appearance preferences
set dark mode to not dark mode
end tell
end tell
This is the link about How to use the Dock.