AppleScript to Change Cursor Size - need help with Ventura

As a teacher, I found it useful to adjust the cursor size when my screen was shared with the TV. I had a perfectly working script (found somewhere on the internet) that I accessed through the TouchBar using BetterTouchTool.

Unfortunately Ventura rearranged the whole system settings/preference panes. I know “Systems Preferences” needs to change to “System Settings”, but I am unsure about the other system calls, not sure what needs to be updated or modified.

Any help or advice is much appreciated.

My old AppleScript for toggling cursor size (pre-Ventura):

tell application "System Preferences"
	reveal anchor "Seeing_Cursor" of pane id ""
	-- delay 0.1
	tell application "System Events"
		set contentView to tab group 1 of group 1 of window "Accessibility" of application process "System Preferences"
		set theSlider to slider "Pointer size:" of contentView
		set stash to value of theSlider
		if stash > 1 then
			set value of theSlider to 1.0
			set value of theSlider to 4.0
		end if
	end tell
end tell

Could you try recording your actions, then edit your script accordingly?

Thanks for the good idea but unfortunately it did not record anything.

I’m sorry not to be able to provide a solution but I can give a pointer to the problem. As you say, System Preferences (referenced in the script) has in Ventura changed to System Settings. However, simply changing those references in the script will almost certainly not result in a working script, I’m afraid. The reason appears to be that AppleScript is not currently working properly with System Settings in Ventura (or, at least, if it is, nobody yet seems to have discovered how it works—in particular in terms of discovering anchors of the new panes).

It is possible directly to access many system settings panes (using*) and substituting the name of the relevant pane for the wildcard. However, as I said, I’m not aware that anyone has yet discovered a way of then moving to an anchor of that pane (or, indeed, finding out what anchors it has).

Sorry not to be more helpful.