Last active
June 14, 2022 17:40
-
-
Save stek29/dd27759e5c96de21a33009ac914b9f4e to your computer and use it in GitHub Desktop.
Revisions
-
stek29 revised this gist
Jun 14, 2022 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,6 +4,7 @@ tell application "System Events" tell application "System Preferences" set current pane to pane id "com.apple.preference.startupdisk" activate delay 1 end tell tell application process "System Preferences" -
stek29 revised this gist
Nov 4, 2021 . 1 changed file with 59 additions and 62 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,68 +1,65 @@ do shell script "diskutil mount disk0s3" tell application "System Events" tell application "System Preferences" set current pane to pane id "com.apple.preference.startupdisk" activate end tell tell application process "System Preferences" delay 0.3 tell window "Startup Disk" set lockFound to false repeat with x from 1 to number of buttons if lockFound is false then if title of button x is "Click the lock to make changes." then click button x set lockFound to true repeat while title of button x is "Authenticating..." delay 1 end repeat else if title of button x is "Click the lock to prevent further changes." then set lockFound to true end if else exit repeat end if end repeat set targetPrefix to "Windows" set targetIndex to 0 set options to group of UI element 1 of scroll area 1 repeat with i from 1 to number of options set x to item i of options if name of UI element 3 of x starts with targetPrefix then set targetIndex to i exit repeat end if end repeat if targetIndex is 0 then error "cant find " & targetPrefix & " in list of options" end if key code 48 delay 0.1 repeat with i from 1 to number of options key code 123 delay 0.1 end repeat repeat with i from 2 to targetIndex key code 124 delay 0.1 end repeat click button "Restart…" delay 0.3 click button "Restart" of sheet 1 return true end tell end tell end tell -
stek29 renamed this gist
Nov 2, 2021 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
stek29 created this gist
Nov 2, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,68 @@ tell application "System Events" try tell application "System Preferences" set current pane to pane id "com.apple.preference.startupdisk" activate end tell tell application process "System Preferences" delay 0.3 tell window "Startup Disk" set lockFound to false repeat with x from 1 to number of buttons if lockFound is false then if title of button x is "Click the lock to make changes." then click button x set lockFound to true repeat while title of button x is "Authenticating..." delay 1 end repeat else if title of button x is "Click the lock to prevent further changes." then set lockFound to true end if else exit repeat end if end repeat set targetPrefix to "Windows" set targetIndex to 0 set options to group of UI element 1 of scroll area 1 repeat with i from 1 to number of options set x to item i of options if name of UI element 3 of x starts with targetPrefix then set targetIndex to i exit repeat end if end repeat if targetIndex is 0 then error "cant find " & targetPrefix & " in list of options" end if repeat with i from 1 to number of options key code 123 delay 0.1 end repeat repeat with i from 2 to targetIndex key code 124 delay 0.1 end repeat click button "Restart…" delay 0.3 click button "Restart" of sheet 1 return true end tell end tell on error delay 0.5 tell application "System Preferences" if current pane is pane id "com.apple.preference.startupdisk" then quit end tell return false end try end tell