Slow down Open at Login

Weird problem here. I have an Mac mini M2 Pro running Sequoia 15.1 with a very recent install of all software. Microsoft SharePoint is opened at Login so that OneDrive is available. The problem is that I use an external SSD for the OneDrive folder location and the SSD has not mounted by the time that SharePoint is looking for it. So, I get a notice with an offer to essentially reset/erase OneDrive information or Try Again. Of course, I pick Try Again, but I don't want to have to pick it everytime. I am not even sure where to ask the question (and I have given up on asking Microsoft Support things directly, because it has become pointless). Any suggestions on how I can automatically start OneDrive with Login after the external drive with the OneDrive folder has mounted?

You could run a macro at login instead of putting SharePoint in your login items. The macro can Pause Until the drive is mounted:

image

After the pause, open the SharePoint application. In theory, this should work. In practice, I can't test any of it :).

-rob.

1 Like

Maybe something like this would work for you.

You would need to change the two appearances of a dummy path to your OneDrive folder, of course.

I have presumed that Sharepoint is an application and have mocked that up in this example accordingly.

1 Like

It could be that Sharepoint is running at logout time, and so the Mac relaunches it on login.

This solution worked, which surprised me. I figured that SharePoint or OneDrive would get stuck before the application could be quit. Thanks for your help.

1 Like

One would think your solution would work, except apparently setting SharePoint to Open at Login is not easily squashed. And I was going to try your method, but it may not work reliatbly. SharePoint to Open at Login keeps coming back from my reading of complaints in Microsoft.com forums.

Durn, that's too bad :(.

-rob.

The program Lingon X might be able to help prevent it from reactivating Open at Login. Or if you know how to muck around with the LaunchDaemons, maybe you could put a "fake" file there to block the program from re-adding the file?

For clarification, within which section of the System Settings is the Sharepoint login item? Open at Login or Allow in the Background? Is OneDrive also in either (or both) of those sections? If so, which?

Maybe you already read this thread on the Microsoft forums, but this comment notes that OneDrive adds SharePoint to the login items via a background process after every update to OneDrive.

Microsoft forum comment

I don't really use OneDrive or Microsoft generally, but I have MS Office 2016 installed for Excel (because you can't just install one piece of software, Microsoft makes you install them all ಠ_ಠ), and I have never seen SharePoint emerge anywhere (though I don't usually ever do anything with OneDrive)—perhaps this is because it's an older version of Office (though I checked the package contents and SharePoint is inside my copy of OneDrive; however, I have also disallowed Microsoft from running the following background processes, which maybe has something to do with it. I'd check my other Mac where OneDrive is active, but I can't access it just now. You could test it in the meantime, though, just to see what happens.

The steps I would try first
  1. Kill all running processes for both OneDrive and SharePoint via btop/htop/Activity Monitor/etc
  2. If both OneDrive and SharePoint appear in this section of the login items, I would remove both from here
  3. Disable Microsoft from running any processes in the background
  4. Write a macro to launch OneDrive using the Mounted Volume Trigger

Alternatively, I found the following on StackExchange. There looks to be a variety of potential solutions, maybe it can be of some use? I've not tried or tested any of them, though.

Out of interest, is there any particular reason to use Pause Until instead of the Mounted Volume Trigger? It seems like using the volume mounting to trigger the macro would save a step and maybe even be more reliable? Although maybe I'm missing something obvious.

I'm glad it was suitable. :+1:

I was interested by @hemicyon's mention of the "mounted volume" trigger. I suppose you could use that to trigger a macro that:

  1. quits Sharepoint;
  2. pauses if necessary;
  3. activates Sharepoint.

That could be a better or worse method than my previous suggestion, depending on your needs (your usage of the external drive, and its behaviour and reliability, say).

I wasn't sure if the macro would be part of something else or not, so the pause seemed the safest way to have it usable if it were part of something else. But yea, the trigger should work fine too, and thanks for bringing it up!

-rob.

1 Like

I appreciate your suggestion and will keep it in mind if the current solution breaks suggested by kevinb breaks.

Your steps is what I thought might be needed when you suggested your quit OneDrive sequence, but I could not figure out how to access SharePoint that is in contents folders that is in the OneDrive app itself. I could not readily see how to access SharePoint. I crossed my fingers and hoped that using your quit OneDrive sequence would work. And it did.

Decided to test this a bit more because Microsoft's nonsense makes me so angry.

I have successfully prevented OneDrive (and thus also SharePoint) from launching at login (at the system level) by un/toggling these background process switches in Login Items in the System Settings. Initially, it seemed like OneDrive needed to be quit prior to shutdown in order to not be automatically launched, but I restarted several times with these settings without quitting OneDrive first, and OneDrive did not launch at login. Though you'll want to double check that neither OneDrive nor SharePoint are listed in the Open at Login section.

I should note though that I also manually edited the plist as detailed in this StackOverflow post, but it was the first thing I tried and I never went back to undo that change to test if it was necessary to stop OneDrive from launching at login.

Then, even though I was confident this part would work, I made this macro and tested it anyway. And, of course, it works to launch OverDrive once Keyboard Maestro detects that the drive is mounted.

I mentioned previously that I didn't know whether this would work differently for me since I'm on Office 2016, but I realised that OverDrive is a free app (even when bundled in the standalone package version) and so my OverDrive is currently at v24, so I can't think of any reason why it shouldn't work for anyone with newer or older versions of Office (though who knows, this is Microsoft after all).

I appreciate your follow-up. I was starting to answer your previous questions that are now moot, when I was called away to mangle breakfast cooking. BTW, do you have any idea what the difference is between Microsoft OneDrive and OneDrive in Allow in the Background as shown in your screenshot? FWIW, I am on OneDrive version 24.206.1013 on macOS 15.1.

I am using a base Mac mini M2 Pro and want OneDrive to launch at startup when the external drive is mounted, so the first suggestion that worked is what I will use for now. I am stuck with Microsoft 365 for work purposes as Microsoft tries to destroy itself. But something happened a few days ago that was the final straw for Windows 11 Pro, so I am finally making a full time switch to Mac after 30 years of living in both worlds. (I don't even recall what the final straw was, because there are so many.) I look forward to becoming proficient with KM and other cool Mac automation tools.

I appreciate all the different suggestions everyone has offered to help solve my problem. I will not be surprised if I need to revisit this thread.

I don't know what the actual difference is, no. But only one of them existed before I opened OneDrive (v24.211.1020.0001 [Standalone]) on this Mac (M2 MacBook Air macOS 14.7.1). Upon launching OverDrive for the first time, the second one appeared. With both selected, OverDrive autolaunches at login even though it doesn't exist in the Open at Login section. With only the Microsoft OverDrive selected (required for OverDrive to run I think) as shown in my screenshot, OverDrive does not autolaunch at login.

I made the assumption that your external drive mounts automatically when the Mac boots up, which makes for a very simple macro to achieve what you want because the macro should trigger precisely when the folder is accessible and then just one action to launch OverDrive at that moment without needing to quit, pause for some indeterminant amount of time, and relaunch.

My resentment of Microsoft's shenanigans drove me to solve the problem that should never have been a problem in the first place—disable autolaunch at login.

Curiosity got the better of me.

e3fb709d947ac77ae6dcadf131e845582e8cc592_2_690x316
Microsoft OneDrive on and OneDrive off works for me reliably with OneDrive on or off at restart using the Triggered by This volume EXTERNAL DRIVE is mounted condition to activate OneDrive. It is a more elegant solution, so I will stick with it until Microsoft breaks it.

I really do appreciate all the helpful suggestions and the many ways to solve my problem. It makes me excited to further explore KM. Thanks!!

PS I did not edit the PLIST

1 Like