I’m experiencing some weird problem. It looks like some property value is persisted. Also, it seems that the property is set only on the first assignment, and after that it can’t be changed. But that would be really weird. I can’t reproduce the behaviour though. The situation is something like this script:
use scripting additions property test : missing value on get_string_default(domain, key_name, default_value) try return (do shell script "defaults read" & space & domain & space & key_name) on error number 1 return default_value end try end get_string_default on run set test to get_string_default("nl.archipunt.test-script", "test_key", "the_default_value") display alert "Persistent property test!" message "Value of property test: »" & test & "«" test end run
I can override and delete the defaults with these commands:
defaults write nl.archipunt.test-script test_key -string "the_override_value" defaults delete nl.archipunt.test-script test_key
I compile the script via the command line to an
app, and also sign it, like this:
osacompile -x -o "Test_Script.app" "test.applescript" xattr -cr "Test_Script.app" codesign --sign "Developer ID Application: XXXX (YYYYY)" "Test_Script.app"
In my real situation (above is my trial to isolate) the value in the alert doesn’t change after the first run. In the script above, it does.
However, one thing I noticed: when I check the signature with WhatsYourSign right after it is compiled, the signature is valid. After it has ran, the app has signing issues… (
sign auth: unknown (status/error: -67054)_
So could one advise on why the signature is not valid anymore? And does anyone recognize this weird property behaviour? Any pointers?