osx - How to make AppleScript change the time in system preferences -
okay goal script make changes time 1 second every 1 second. in way stop time on mac. got far script. note in () script there suppose do. aka me.
set pasword ("my password") tell application "system preferences" activate end tell delay 3 tell application "system events" tell process "system preferences" click menu item "date & time" of menu "view" of menu bar 1 delay 2 tell window "date & time" (click authentication lock.) tell application "system events" keystroke pasword delay 1 tell application "system events" keystroke return delay 1 (uncheck set time data , time automatically checkbox) delay 1 repeat (select seconds above clock) (click top arrow right next it) (click save) delay 1 end repeat end tell end tell end tell end tell end tell
so whole script, got stuck in areas , i'm looking help. thanks.
you can use app called uielementinspector determine names , hierarchies of ui elements trying interact with. example, “the set time , date automatically checkbox” have name “checkbox 3.”
however, feeling won’t able accomplish trying script, because gui scripting (when tell system events interact part of gui) has poor timing. while might possible in typical applescript run command , wait second , run command , wait second , run command (although there, going out of sync) gui scripting, first time run script might take 2 seconds go second back, 1.5 seconds, 3 seconds, , second time run script entirely different.
you better result using “do shell script” applescript command set time using command line shell scripting.
changing system date command line
definitely aware may see unexpected behavior entire computer if messing system clock in manner describe, though. see data loss (especially network syncing) or might crash mac or make unable boot.
Comments
Post a Comment