Hi Everyone,
I’m trying to change the default clock to analog, This doesn’t seem to work on macOS 13.2.1. I tried the following in the terminal and could only find the following.
The key is “IsAnalog”. The following works on my Ventura computer:
-- toggle digital and analog
set currentValue to (do shell script "defaults read com.apple.menuextra.clock 'IsAnalog'") as integer as boolean
do shell script "defaults write com.apple.menuextra.clock 'IsAnalog' -bool " & (not currentValue) & ";"
-- set to analog
-- do shell script "defaults write com.apple.menuextra.clock 'IsAnalog' -bool true"
set currentValue to (do shell script "defaults read com.apple.menuextra.clock 'IsAnalog'") as text
if currentValue is "1" then
set newValue to "false"
else
set newValue to "true"
end if
do shell script "defaults write com.apple.menuextra.clock 'IsAnalog' -bool " & newValue
Jacck. I retested my modification of your orginal script–both from within Script Debugger and as an app on the desktop–and it worked fine. There are a few instances in which the script would not work, and the following should fix those:
try
set currentValue to (do shell script "defaults read com.apple.menuextra.clock 'IsAnalog'") as integer as boolean
on error
set currentValue to false
end try
do shell script "defaults write com.apple.menuextra.clock 'IsAnalog' -bool " & (not currentValue)