macOS Sonoma introduces a revised Screen Sharing application that lives in the Applications → Utilities folder1Though that's not really where it is, but that's not important…. It presents a list of recently-connected devices:
Select one, and you'll see the username and password dialog for that machine. While the GUI is nice to have, it's also slower than the old method: In Ventura and earlier, you could launch the (not in Utilities) Screen Sharing application, and start typing the IP address:
Select the host from the list, and you were done. This is much quicker than launching an app and waiting for the GUI, then navigating and selecting the desired machine. After just a bit of digging, I found a much quicker way to connect to my Macs in Sonoma (and earlier versions of macOS): The "vnc" URL scheme.
Paired with Keyboard Maestro or similar tool of your choosing, remote access can be incredibly easy and fast (and possibly insecure, if you so choose).
Connecting to a Mac (or other machine) on your network can be done via Terminal or AppleScript very easily. In Terminal, you can connect with this command:
Replace user with your user's short username (i.e. the name on your home folder in Finder), and host with the IP address of the other machine. When you press Return, you'll be greeted by the username/password prompt to connect to the remote machine.
And if you don't care about passwords in plain text and onscreen, you can even skip that step with this format:
Do that, and you'll directly connect without any dialog. But as noted, the password(s) for your other Mac(s) is now in plain text, logged, and possibly stored in a script if you choose to go that route. It's up to you as to whether that's worth saving press Return or not—for me, it's not.
In AppleScript, you could do the above with a do shell script action, or directly via the Screen Sharing application:
tell application "Screen Sharing" GetURL "vnc://user@host" end tell
As before, you can make this instantaneous and insecure by using user:password to skip the login dialog box.
Because I use this feature a lot, I wrote a quick Keyboard Maestro macro to make it simple to connect to any of my three Macs.
When I press the macro's defined hot keys, I see the pop-up menu at right; I've posted the macro over on the Keyboard Maestro forums, but it's ridiculously simple—just a Prompt With List action with the IP addresses encoded, and then pass the chosen entry's IP address to a Shell Script action with the open vnc... bits in it.
I did add a bit of logic so you can't select the Mac you're currently using, but that was also very simple and added no steps, just a couple of conditions, to the macro.
These timesavers won't help when I need to connect to a relative's Mac for tech support, but they make my in-home screen sharing sessions much quicker to launch.