I think is better compiling all in Apple script, you can check the dark mode status
tell application "System Events"
tell appearance preferences
set dark mode to not dark mode
set scuro to get dark mode
if scuro then
do shell script "
defaults write com.apple.universalaccess reduceTransparency -bool true;
killall Spotlight;
killall Finder;
defaults write com.apple.universalaccess reduceTransparency -bool false;
killall Dock;
killall Finder;
killall NotificationCenter;
defaults write com.apple.universalaccess reduceTransparency -bool true;
killall Spotlight;
defaults write com.apple.universalaccess reduceTransparency -bool false;
defaults write -g CGFontRenderingFontSmoothingDisabled -bool NO;"
else
do shell script "
defaults write com.apple.universalaccess reduceTransparency -bool false;
killall Finder;
killall Dock;
killall NotificationCenter;
defaults write com.apple.universalaccess reduceTransparency -bool true;
killall Finder;
killall Spotlight;
defaults write com.apple.universalaccess reduceTransparency -bool false;
killall Finder;
killall Dock;
killall NotificationCenter;
defaults write com.apple.universalaccess reduceTransparency -bool true;
killall Finder;
killall Spotlight;"
end if
end tell
end tell
Do we know the file where the setting 'defaults write -g CGFontRenderingFontSmoothingDisabled -bool NO' is written?
Thank you!