Launch Subsection of Settings App?

Is there a way to directly launch Settings > iCloud > HideMyEmail window via keyboard shortcut?

you can try this apple script, however it's pretty slow:

do shell script "open x-apple.systempreferences:com.apple.systempreferences.AppleIDSettings?iCloud"

tell application "System Settings"
	delay 0.1
	activate
	
	tell application "System Events" to tell process "System Settings"
		repeat until splitter group 1 of list 1 of window "iCloud" exists
			delay 0.1
		end repeat
		
		
		
		click UI element 2 of group 3 of scroll area 1 of group 1 of list 2 of splitter group 1 of list 1 of window "iCloud"
		
	end tell
	
end tell

Thanks for the code @Andreas_Hegenberg

I actually got it working with this code:


tell application "System Settings"
	activate
end tell

tell application "System Events"
	tell application process "System Settings"
		tell splitter group 1 of group 1 of window 1
			repeat until outline 1 of scroll area 1 of group 1 exists
				delay 0
			end repeat
			tell outline 1 of scroll area 1 of group 1
				set row_names to value of static text of UI element 1 of every row
				repeat with i from 1 to (count row_names)
					try
						if item 1 of item i of row_names contains "Apple ID" then
							select row i
							exit repeat
						end if
					end try
				end repeat
			end tell
		end tell
	end tell
end tell

tell application "System Events"
	tell application process "System Settings"
		tell splitter group 1 of group 1 of window 1
			tell group 2 to tell group 1 to tell scroll area 1 to tell group 3
				repeat until UI element 1 exists
					delay 0
				end repeat
				click UI element 1
				repeat until UI element 2 exists
					delay 0
				end repeat
				click UI element 2
			end tell
		end tell
		repeat until text field 1 of group 2 of group 1 of group 1 of group 1 of UI element 1 of scroll area 1 of sheet 1 of window 1 exists
			delay 0
		end repeat
		tell window 1 to tell sheet 1 to tell scroll area 1 to tell UI element 1
			tell group 1 to tell group 1 to tell group 1
				click text field 1 of group 2
			end tell
		end tell
	end tell
end tell

this doesn't work for me, maybe different version of macOS? (I'm on 14.2.1)
But glad you got it working!

1 Like