Creating an AppleScript to edit a setting in 'System Preferences' -
i using applescript create script turn on "remote login" in system preferences without actual window opening.
below code working still opens system preferences window, therefore can see doing:
tell application "system preferences" launch tell application "system preferences" set current pane pane "com.apple.preferences.sharing" tell application "system events" set visible of process "system preferences" false tell application "system events" tell process "system preferences" click checkbox 1 of row 5 of table 1 of scroll area 1 of group 1 of window "sharing" tell application "system preferences" quit end tell end tell i have tried various lines such as:
tell application "system events" set visible of process "system preferences" false but still doesn't give me result want.
my question is, there line(s) can write can hide window while process? thanks.
you can avoid open system preferences, can start ssh (remote login) shell, applescript command be:
do shell script "launchctl load -w /system/library/launchdaemons/ssh.plist" user name (short user name of (system info)) password "currentuserpasssord" administrator privileges replace currentuserpassword password of current user, required administrator.
Comments
Post a Comment