Open OneDrive in existing instance instead of a new instance

See screenshots. Usually, when I open an app, a dot appears below the open app’s icon in the menu bar. When I click on the icon with one of those dots under it, the app opens to the last window open. But no dot appears under my one drive icon. When I click on that icon the first time, a finder windows opens. Sometimes I then go on to other actions and them want to return to OneDrive. But when I c;ick on the menu icon, a new finder window instance opens. How can I change this behaviour?


The AI Grok3 offers these suggestions:

On macOS, the behavior you’re describing with OneDrive—where clicking its Dock icon opens a new Finder window instead of bringing the existing one to the foreground—is tied to how OneDrive integrates with the system and how macOS handles app instances. Unlike typical macOS apps that maintain a single instance and switch to an existing window when re-clicked, OneDrive’s Dock icon is often a shortcut to opening a new Finder window for its synced folder rather than managing an app window itself. The lack of a dot under the icon might also indicate that OneDrive is running as a background process (via the menu bar) rather than a traditional foreground app with a persistent window.

Here’s how you can address this and modify the behavior:

Why This Happens

  • OneDrive’s Design: OneDrive on macOS primarily operates through the menu bar and syncs files to a folder in Finder. Clicking the Dock icon typically triggers a command to open the OneDrive folder in a new Finder window rather than focusing an existing one.

  • No Persistent App Window: Unlike apps like TextEdit or Safari, OneDrive doesn’t maintain its own app window—it relies on Finder to display its contents. This is why no dot appears, as the “app” isn’t technically active in the Dock sense.

  • Finder Behavior: Finder itself doesn’t treat multiple windows as belonging to a single “instance” of an app in the same way other apps do, and OneDrive leverages this.

Solutions to Open the Existing Instance

There’s no direct built-in setting in OneDrive or macOS to force the Dock icon to focus an existing Finder window instead of opening a new one, but you can work around this with the following approaches:

  1. Use the Menu Bar Icon Instead
  • OneDrive’s menu bar icon (the cloud symbol) is its primary interface on macOS. Clicking it typically shows a status menu, and you can select “Open OneDrive Folder” (or a similar option depending on your setup) from there.

  • This usually reopens the existing Finder window if it’s already open, especially if you’ve only got one OneDrive account synced. Test this first to see if it consistently brings the existing window forward.

  1. Modify Finder’s Behavior
  • Finder itself can be adjusted to minimize duplicate windows:

    1. Open Finder > Preferences (or Settings, depending on your macOS version).

    2. Go to the General tab.

    3. Under “New Finder windows show”, select your OneDrive folder (e.g., ~/OneDrive or wherever it’s synced).

    4. Check the box for “Open folders in tabs instead of new windows” (in the same preferences window under the General tab).

  • Now, when you click the OneDrive Dock icon, it might open a new tab in an existing Finder window rather than a separate window, assuming OneDrive respects this setting. This doesn’t fully solve the “existing instance” issue but reduces window clutter.

  1. Create a Custom Script

For more control, you can create a script to check for an existing OneDrive Finder window and focus it, then replace the Dock icon’s default behavior:

  1. Open Script Editor (found in /Applications/Utilities/).

  2. Paste the following AppleScript:

applescript

tell application "Finder"
    if (count of (Finder windows whose name contains "OneDrive")) > 0 then
        set index of first Finder window whose name contains "OneDrive" to 1
    else
        make new Finder window at folder "OneDrive" of home
    end if
    activate
end tell
  • Replace “OneDrive” with the exact name of your OneDrive folder if it’s different (e.g., OneDrive - CompanyName).
  1. Save it as an application (e.g., OneDrive Launcher.app) via File > Export and choose “Application” as the format.

  2. Drag this new app to your Dock and use it instead of the default OneDrive icon. When clicked, it will bring an existing OneDrive window to the front if one exists or open a new one if none do.

  3. Check OneDrive Settings

  • Open OneDrive preferences:

    1. Click the OneDrive cloud icon in the menu bar.

    2. Select Preferences (or Settings).

    3. Look under the General or Account tab for options like “Open at Login” or folder-specific settings.

  • Ensure OneDrive isn’t configured to always open a fresh window. There’s no explicit “reuse window” option, but confirming the sync folder location might help troubleshoot.

  1. Reinstall OneDrive (Optional)
  • If the above don’t work, the Dock icon’s behavior might be due to a misconfigured installation:

    1. Quit OneDrive (via the menu bar > Quit OneDrive).

    2. Drag the OneDrive app from /Applications/ to the Trash.

    3. Reinstall it from the Mac App Store or Microsoft’s website.

    4. Set it up again and test the Dock icon behavior.

Notes

  • The “dot” not appearing is normal if OneDrive runs as a background service rather than a foreground app. You’d only see a dot if OneDrive had an active window of its own (not a Finder window).

  • If you’re using multiple OneDrive accounts (e.g., personal and work), ensure you’re targeting the right folder in any customizations, as each account syncs to a uniquely named folder (e.g., OneDrive - Personal, OneDrive - WorkName).

Try the menu bar option first, as it’s the simplest. If that doesn’t consistently work, the AppleScript solution gives you the most precise control. Let me know how it goes or if you need further tweaking!

Thanks for this information. I’ll try it out and let you know how it goes.