To change a value in Plist in MAC OS, please suggest the action script

Need your view… as I believe I am doing some mistake in given action script…

wait defaults write “{ pathname of file whose (name of it starts with
"com.apple.locationd.” and name of it ends with “.plist”) of folder
"/private/var/db/locationd/Library/Preferences/ByHost"}"
“SMTPServicesEnabled” -Num 1

Although the relevance is working fine…

Q: pathname of file whose (name of it starts with
"com.apple.locationd." and name of it ends with “.plist”) of folder
"/private/var/db/locationd/Library/Preferences/ByHost"
A: /private/var/db/locationd/Library/Preferences/ByHost/com.apple.locationd…24B27E28-887C-56E5-B3A4-638E611AEEF5.plist

Note : com.apple.locationd…24B27E28-887C-56E5-B3A4-638E611AEEF5.plist is not unique in every system.

Check the client logs to see what it’s running:
http://www-01.ibm.com/support/docview.wss?uid=swg21505873#clientlogs

That should tell you if the relevance is working during the action. You’ll likely find that “-Num” is producing an error. Try using “-int”.

@rustymyers. It is still not working even after adding the -int … that we have already tried earlier… sir… pls suggest any other way…to get the fixed.

Post the action logs from the client. That should help identify the issue.

@rustymyers… no such logs has created for that action which i have applied on mac machines …

@rustymyers.

I have found the logs after reapplying action on mac machine…

Command failed (Relevance substitution failed) wait defaults write “{pathname of file whose (name of it starts with “com.apple.locationd.” and name of it ends with “.plist”) of folders “/private/var/db/locationd/Library/Preferences/ByHost”}” “SMTPServicesEnabled” -int 1

@rustymyers… now getting another error after escaping the “}”

Command succeeded (Exist Code=0) wait defaults write “(pathname of file whose (name of it starts with “com.apple.locationd.” and name of it ends with “.plist”) of folders “/private/var/db/locationd/Library/Preferences/ByHost”)”
“SMTPServicesEnabled” -int 1

or

Command succeeded (Exist Code=0) wait defaults write “pathname of file whose (name of it starts with “com.apple.locationd.” and name of it ends with “.plist”) of folders “/private/var/db/locationd/Library/Preferences/ByHost”” “SMTPServicesEnabled” -int 1

Looks like the relevance is finding multiple files:

Q: pathnames of files whose (name of it starts with "com.apple.locationd." and name of it ends with ".plist") of folders "/private/var/db/locationd/Library/Preferences/ByHost"
A: /private/var/db/locationd/Library/Preferences/ByHost/com.apple.locationd.AC2ED975-4541-58EA-AAA8-7D32CD714564.plis%08
A: /private/var/db/locationd/Library/Preferences/ByHost/com.apple.locationd.notbackedup.AC2ED975-4541-58EA-AAA8-7D32CD714564.plist

Try using this relevance (don’t escape it):

pathnames of files whose (name of it starts with "com.apple.locationd." and name of it ends with ".plist" and name of it does not contain "notbackedup") of folders "/private/var/db/locationd/Library/Preferences/ByHost"
1 Like

Thanks @rustymyers… I have so confused and forget to add the notbackedup … result of which the relevance get confused to determine the exact key location…

Thanks for your time & suggestion…

1 Like