I have a tick box that the value of is bound to the variable ‘automaticallyEmptyTrash’.
I have then tried to set the variable ‘automaticallyEmptyTrash’ to the default with…
I added the following to the line I’m working with. ‘Say 1’ DID work, and automaticallyEmptyTrash said ‘false’, so the so the default is being read, but the tick box does not alter its state to reflect the altered state of the variable, it’s always ticked (true). I think there’s something wrong with my approach to ALL the 'set to defaults’s’ lines, but I don’t know what. I thought tick boxes and display fields with numbers would update with the variables read from ‘defaults’s’.
Should I Perhaps have a ‘my’ in front of the variables? I did try that, but it did not seem to work.
However, this one 'set’, and ONLY this one, works.
try
set p to 7
set tempMailManagerDesktopFolderPath to defaults's objectForKey:"mailManagerDesktopFolderPathArchive"
tell application "Finder"
try
set my mailManagerDesktopFolderPath to (tempMailManagerDesktopFolderPath as text) as alias as text
end try
end tell
end try
Regards
Santa
say 1
try
set automaticallyEmptyTrash to defaults's objectForKey:"autoEmptytrash"
say 2
say automaticallyEmptyTrash as text —< false, but bound to value tick box is ‘true'
say 3
on error
say "error in setting trash empty default"
set my automaticallyEmptyTrash to true
end try