I having an issue copying the script I wrote in MacOS 11.6 to 10.11.6
The script works just fine in Script Debugger, but when I save it as an applet, both Enhanced and Apple, I get this error message in the Apple Applet:
The 'prepare storage' command was unable to initialize user defaults. Unknown error (-2700)
With buttons Edit and OK, which work.
In the Enhanced Applet I get this error message
Runtime Script Error
The 'Prepare storage' command was unable to initialize user defaults. Unknown error.
The only button is “Quit” but as soon as I hit quit a new dialog appears, and that repeats until I force quit.
The 'assign value' command failed, with the error: The 'prepare storage' command has not yet been called by this script
The only button is quit, and hitting quit goes into an endless repeat where that second dialog keeps popping up, until I force quit.
Below are the handlers that I use to initialize get and store persistent variables.
→ Script Debugger: 7.0.13 (7A125)
→ PrefsStorageLib: 1.1.0 (8)
→ Mac OS: 10.11.6 (15G22010)
on PersistentVariables()
prepare storage for (path to me) ¬
default values {itemsToVersion:{}} ¬
without write lock
set my itemsToVersion to value for key "itemsToVersion"
end PersistentVariables
on SavePersistentValues()
assign value itemsToVersion to key "itemsToVersion"
end SavePersistentValues