I am trying to create an AppleScript, which will toggle a preference in an application called Anxiety. I am doing this through the PLIST file, and when I open the file in Property List Editor, the value is a checkbox.
The code below is what I am trying. It doesn't work because the value isn't TRUE or FALSE, it's a checkbox, and I don't know how to toggle that. Any help would be greatly appreciated!
try
set toggle to do shell script "defaults read com.modelconcept.Anxiety hideOnDeactivate"
if toggle = "TRUE" then
do shell script "defaults write com.modelconcept.Anxiety hideOnDeactivate FALSE"
else
do shell script "defaults write com.modelconcept.Anxiety hideOnDeactivate TRUE"
end if
end try
The code below is what I am trying. It doesn't work because the value isn't TRUE or FALSE, it's a checkbox, and I don't know how to toggle that. Any help would be greatly appreciated!
try
set toggle to do shell script "defaults read com.modelconcept.Anxiety hideOnDeactivate"
if toggle = "TRUE" then
do shell script "defaults write com.modelconcept.Anxiety hideOnDeactivate FALSE"
else
do shell script "defaults write com.modelconcept.Anxiety hideOnDeactivate TRUE"
end if
end try