I have a use-case where I have to store array of strings in defaults write but it seems like it is not working in applescript.
do shell script "defaults write com.subdomain.xyz -array \"abc\" \"abcd\" \"abcde\""
error
error "2022-06-17 13:47:40.780 defaults[5694:216572] Unexpected argument abcd; leaving defaults unchanged." number 1
CodePudding user response:
You aren’t declaring a key. Here, I added the array name myNewArray as key:
do shell script "defaults write com.subdomain.xyz myNewArray -array " & ¬
"\"abc\" \"abcd\" \"abcde\""