How to open Software Update in System Settings on Ventura from applescript?

This no longer works the way it used to back in older versions when System Settings was System Preferences, i.e. set the current pane to pane id "com.apple.preferences.softwareupdate"

I had a little applescript saved as an app that would open Preferences to Software Update, and open the App Store and send it the keystroke shortcut for its Updates tab (since App Store is apparently not properly scriptable). Handy to quickly check both, but doesn't work anymore :-(

I've been working on this. System Settings on Ventura is not scriptable, at least for now, so you must use GUI Scripting. Here is what I have working so far in my Project:

activate application "System Settings"
tell application "System Events"
	tell process "System Settings"
		delay 1
		tell splitter group 1 of group 1 of window 1
			tell group 1 -- sidebar
				tell outline 1 of scroll area 1
					set rowCount to count of rows
					repeat with rowNum from 2 to rowCount - 1
						if (exists static text 1 of UI element 1 of row rowNum) then
							if value of static text 1 of UI element 1 of row rowNum is "General" then
								select row rowNum
								exit repeat
							end if
						end if
					end repeat
				end tell
			end tell
			delay 1
			tell group 2 -- window pane
				tell group 1 of scroll area 1 of group 1 -- top
					click button 2
				end tell
			end tell
		end tell
	end tell
end tell

Clever if more complex than my limited AppleScript experience would have led me to. :-)

But I don't recall System Settings (or some other choices) being in the sidebar, only in the View menu. If there's a way to add those to the sidebar, I haven't found it yet, although it will temporarily appear if searched for.

System Settings is the name of the application that used to be known as System Preferences. In macOS Ventura, you open System Settings by choosing the "System Settings..."menu item near the top of the Apple menu, at the left end of the standard menu bar. When you oopen System Settings that way, its window always has a sidebar containing the items that used to be shown as preference pane icons. They are listed, not grouped by named categories as they used to be. And some things that I think used to be shown as preference panes now appear instead as items in the main window when General is selected in the sidebar.

Yes, turns out Software Update is under General (like on iPhones/iPads).

I found an example of scripting the activation of menu items. do_menu is from http://www.macosxautomation.com/applescript/uiscripting/ with the addition of a delay statement that seemed necessary (adjust as needed); this does exactly what I wanted. Indeed, the menu approach is better than faking keystrokes as I was doing before with the App Store part, because the ⌘R never worked but just caused an alert sound.

on do_menu(app_name, menu_name, menu_item)

    try

	-- bring the target application to the front

	tell application app_name

		activate

	end tell

	delay 2

	tell application "System Events"

		tell process app_name

			tell menu bar 1

				tell menu bar item menu_name

					tell menu menu_name

						click menu item menu_item

					end tell

				end tell

			end tell

		end tell

	end tell

	return true

on error error_message

	return false

end try

end do_menu

do_menu("System Settings", "View", "Software Update")

do_menu("App Store", "Store", "Updates")

do_menu("App Store", "Store", "Reload Page")

I wrote an ebook "AppleScript practical technics (1) GUI Scripting"(PDF 315pages). This book include scripts to show each System Settings pane.

https://piyomarusoft.booth.pm/items/4230018

Off course, more easier books available. Basic technic books (1)...(29).

https://piyomarusoft.booth.pm/item_lists/rBkTpqJm

How to open Software Update in System Settings on Ventura from applescript?
 
 
Q