I am running this script on 10.7 and it works by toggling off disable remote and require password. First problem I am running into is to get the second part to work I have to manually unlock system preferences. Is there a way around this?
Next questions is I would like to modify other parts of the security pane but I have no idea how to target them. I tried just using checkbox 3 but that did not work. What are the numbers for the other settings in the security section. I would like to turn on disable automatic login, require an admin password to access system preferences with lock icons, log out after 14 minutes of inactivity.
Last questions is how do I implement an if statement to check if the box is already checked. if it is skip that box if it is not check then the script would select it. I tried a few if statements but the script just gave an error.
tell application "System Events" tell process "System Preferences" display dialog "Make sure the lock at the bottom left corner of the preference pane is unlocked. If it is not please unlock it now before running the script." with icon note click checkbox 1 of tab group 1 of window "Security & Privacy" -- disable remote --control click checkbox 2 of tab group 1 of window "Security & Privacy" -- Require password -- end tell end tell