Hello All,
Need your help, i have Apple script which will update the macOS for both Intel and M1 and restart if it's M1 it will prompt for the user password to install macOS. now it's working fine when i run from Apple script editor.
But i need to convert the Apple script to run as bash script so that we can push from JAMF.
=========================================================================================
# Launch software Update preference pane
do shell script "open x-apple.systempreferences:com.apple.Software-Update-Settings.extension"
tell application "System Events"
repeat 60 times
if exists (window 1 of process "System Settings") then
delay 3
exit repeat
else
delay 1
end if
end repeat
if not (exists (window 1 of process "System Settings")) then
return
end if
end tell
# Click "Update Now" or "Restart Now" if present
tell application "System Events"
tell process "System Settings"
repeat 60 times
if exists (button 1 of group 2 of scroll area 1 of group 1 of group 1 of group 2 of splitter group 1 of group 1 of window "Software Update" of application process "System Settings" of application "System Events") then
click button 1 of group 2 of scroll area 1 of group 1 of group 1 of group 2 of splitter group 1 of group 1 of window "Software Update" of application process "System Settings" of application "System Events"
exit repeat
end if
tell application "System Events"
if application process "System Settings" exists then
delay 0.5
else
exit repeat
end if
end tell
delay 1
end repeat
tell application "System Events"
if application process "System Settings" exists then
delay 0.5
else
exit repeat
end if
end tell
delay 1
end tell
end tell
end