0

I use the macOS Screen Sharing app a lot, located in:

/System/Library/CoreServices/Applications/Screen Sharing.app

I usually launch the app by clicking any of a series of .vncloc files that I keep in a folder in my dock for quick access. When I'm done, I usually just quit the app. Whenever I launch it again, it attempts to re-open the connection that was previously open during the last run, which usually is different from the vncloc I'm opening at the time.

I know I could prevent this by closing the connection before quitting the app, but I'd like to know if there's a trick to tell it to never reopen connections on launch, or ideally: if I'm opening a connection via a vncloc file, don't re-open previous connections (otherwise do open previous connections).

I don't see that option in the preferences. Is there a way to achieve this?

2
  • I suggest you use the Close option in the Connection menu first before you quit. Perhaps you can craft an Automator action to close the connection and quit the app with a single command.
    – IconDaemon
    Commented Sep 8, 2022 at 18:59
  • Your suggestion and the current answer give me an idea. In the keyboard settings, I can change command-q to map to a service (aka "Quick Action") that types command-option-q if the foremost app is Screen Sharing (otherwise command-q). I've done something similar in the past for other goals.
    – hepcat72
    Commented Sep 8, 2022 at 19:18

1 Answer 1

0

You can press ⌘+⌥+Q to close all windows and quit the app.

This only applies if the system preferences option to reopen windows is enabled (the default setting), since if it's disabled it will always close all windows.

There is no option to disable reopening windows on a per-app basis, and Screen Sharing does not have the options you're looking for built in so you'll have to rely on the system behaviors.

1
  • Accepting this answer, but basically, I'm just careful now about closing the windows before quitting. If you quit with open windows, they re-open automatically (based on the system prefs you mentioned).
    – hepcat72
    Commented Sep 25, 2023 at 15:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .