Hi everyone,
I was trying to save some space (and speed) in my code. Instead of using multiple times the make new default entry thing :
tell user defaults
make new default entry at end of default entries with properties {name:theDefaultEntry, contents:theVariable}
set theVariable to contents of default entry theDefaultEntry
make new default entry at end of default entries with properties {name:OtherDefaultEntry, contents:OtherVariable}
set OtherVariable to contents of default entry OtherDefaultEntry
end tell
-Which does seem to work with my code, the defaults are read. So no problems with writing user defaults etc.
But this doesn’t, I tried moving the tell block inside the repeat loop and back out but it does not seem to read my preferences.
tell user defaults
repeat with i from 1 to 6
set theVariable to item i of {var1, var2, var3, var4, var5, var6}
set theDefaultEntry to item i of {"def1", "def2", "def3", "def4", "def5", "def6"}
make new default entry at end of default entries with properties {name:theDefaultEntry, contents:theVariable}
set theVariable to contents of default entry theDefaultEntry
end repeat
end tell
Nothing seems to happen not even an error popping up. Is this default behavior of the defaults?
Thanks