Can anyone assist with me with converting ‘Patches for Mac OS X’ fixlet ID39 - SECURITY: No password Required on Wake From Sleep or Screen Saver to a Retrieved Property.
If (name of operating system does not contain “Mac”) then “N/A” else if ((name of operating system = “Mac OS X”) AND (system version >= “10.2”)) AND ((not exists file whose (name of it contains “com.apple.screensa” and name of it contains “.plist”) of folder “ByHost” of folder “Preferences” of folder “Library” of folder whose (name of it is name of current user) of users folder) OR ((not exists integer “askForPassword” of it OR integer “askForPassword” of it is not equal to 1) of dictionary of file whose (name of it contains “com.apple.screensa” and name of it contains “.plist”) of folder “ByHost” of folder “Preferences” of folder “Library” of folder whose (name of it is name of current user) of users folder)) then “True” else “False”
Its returning ‘Singular expression refers to a non-unique object’ on one particular host, and im assuming this is occuring due to multiple users being logged in ??. My Mac skills are extremely limited as you can probaly tell.
Q: file whose (name of it contains “com.apple.screensa” and name of it contains “.plist”) of folder “ByHost” of folder “Preferences” of folder “Library” of folder whose (name of it is name of current user) of users folder
E: Singular expression refers to non-unique object.
Q:
files
whose (name of it contains “com.apple.screensa” and name of it contains “.plist”) of folder “ByHost” of folder “Preferences” of folder “Library” of folder whose (name of it is name of current user) of users folder
I’m still getting the same, appreciate if you could point me in the right direction.
If (name of operating system does not contain “Mac”) then “N/A” else if ((name of operating system = “Mac OS X”) AND (system version >= “10.2”)) AND ((not exists files whose (name of it contains “com.apple.screensa” and name of it contains “.plist”) of folder “ByHost” of folder “Preferences” of folder “Library” of folder whose (name of it is name of current user) of users folder) OR ((not exists integer “askForPassword” of it OR integer “askForPassword” of it is not equal to 1) of dictionary of files whose (name of it contains “com.apple.screensa” and name of it contains “.plist”) of folder “ByHost” of folder “Preferences” of folder “Library” of folder whose (name of it is name of current user) of users folder)) then “True” else “False”
So, the problem with that relevance is that “dictionary of” expects a single file. There is an additional problem in that askForPassword may be in the file /Library/Preferences/com.apple.screensaver.plist which is not checked by that Relevance.
I’m not sure if my lone Mac is representative of all the 10.6.x Mac’s out in the world… so please test this Relevance before assuming it will work with all variants of OS X. My askForPassword setting is in /Users/noah/Library/Preferences/com.apple.screensaver.plist, which is not the way the aforementioned Fixlet was written. Based on that you can try this for your property:
Q: If (name of operating system does not contain “Mac”) then “N/A” else if ((name of operating system = “Mac OS X”) AND (system version >= “10.2”)) AND ((not exists file whose (name of it contains “com.apple.screensaver.plist”) of folder “Preferences” of folder “Library” of folder whose (name of it is name of current user) of users folder) OR ((not exists integer “askForPassword” of it OR integer “askForPassword” of it is not equal to 1) of dictionary of file whose (name of it contains “com.apple.screensaver.plist”) of folder “Preferences” of folder “Library” of folder whose (name of it is name of current user) of users folder)) then “True” else “False”
A: False
Here is the same thing but testing a value of 0 instead of 1 to show that the Relevance works (at least on my box):
Q: If (name of operating system does not contain “Mac”) then “N/A” else if ((name of operating system = “Mac OS X”) AND (system version >= “10.2”)) AND ((not exists file whose (name of it contains “com.apple.screensaver.plist”) of folder “Preferences” of folder “Library” of folder whose (name of it is name of current user) of users folder) OR ((not exists integer “askForPassword” of it OR integer “askForPassword” of it is not equal to 0) of dictionary of file whose (name of it contains “com.apple.screensaver.plist”) of folder “Preferences” of folder “Library” of folder whose (name of it is name of current user) of users folder)) then “True” else “False”
A: True
And, just for the record, here is the way to confirm this information from the Mac command line: