Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
Ok, I have to say this whole OneDrive debacle is messy. Since my post, I found a version of my OneDrive directory in my home directory with '(archive)' appended to it. I believe this is where OneDrive initially held the downloaded files, as they are now under your personal Library folder (~username/Library/CloudStrorage/OneDrive-Personal). I'm pretty sure this extra directory (the archive version) is due to me being a long-time OneDrive user, and the OneDrive reset (from the link I posted previously) decided to leave it alone. Having two copies of my OneDrive files (one under the home directory w/archive and one under Library/CloudStorage/OneDrive-Personal), Spotlight showed two entries. It was time to clean up. So here is what works for me *after* you do the OneDrive reset:

1) Remove any OneDrive (archive) directory from your /home/username/
2) Add /home/username/Library or /home/username/Library/CloudStorage to the Spotlight Privacy exclusion under System Settings->Siri & Spotlight->Spotlight Privacy (at the bottom of the window). This will force Spotlight to index the soft link version of OneDrive in your home directory and ignore the real/hidden copy under your personal Library directory.

Let me know how it goes!

ps> I never use OneDrive's File-On-Demand feature so this applies to using OneDrive's Download all files.

I still haven't had success with anything, but reading through this again, I'm confused. In step 1 you say you deleted the OneDrive (archive) directory from your home folder, but then in step 2 you say adding the "real" OneDrive location ([user name]/Library/CloudStorage/OneDrive) to the Spotlight privacy exclusion list will force Spotlight to index the OneDrive (archive) directory you just deleted. How can Spotlight index something that doesn't exist?
 
@usagora the answer is in this sentence and it worked perfectly for me.
"This will force Spotlight to index the soft link version of OneDrive in your home directory and ignore the real/hidden copy under your personal Library directory."

- If there is no OneDrive (archive) just ignore this step.
- Find the folder called "CloudStorage" and Drag&Drop it into the Spotlight Data-Protection area.
- Done
 
@usagora the answer is in this sentence and it worked perfectly for me.
"This will force Spotlight to index the soft link version of OneDrive in your home directory and ignore the real/hidden copy under your personal Library directory."

- If there is no OneDrive (archive) just ignore this step.
- Find the folder called "CloudStorage" and Drag&Drop it into the Spotlight Data-Protection area.
- Done

Then I guess I don't understand what he meant by "the soft link version of OneDrive in your home directory" if he wasn't referring to the "OneDrive (Archive)" directory he said to delete there. Here is my home directory (/Users/[name]), including hidden files/folders. I see nothing to do with OneDrive there.

Screenshot 2023-03-07 at 10.02.56 AM.png
 
The "CloudStorage" folder is hidden ... to find it do the following:
- Go to the Finder menu bar and select "Goto", while the pull down menu is open, press and hold the "Option-Key".
As long as you press the option key, a "Library" entry is visible.
- Klick on "Library" to open the hidden Library folder.
- In this folder you will find the "CloudStorage"-Folder.
- Drag&Drop this folder into the Spotlight-Dataprotection area as mention before.
- Done.
 
Hey guys!

While I can open onedrive files through spotlight, does your CMD+Enter opens the enclosing folder? In my case it straight up opens the file rather than the folder. Is this a bug? :/
 
Hey guys!

While I can open onedrive files through spotlight, does your CMD+Enter opens the enclosing folder? In my case it straight up opens the file rather than the folder. Is this a bug? :/
In my case it opens the file too.
I was not aware of any CMD+Enter shortcut.
 
that sucks, try using the same command at a file stored in icloud, it will open the enclosing folder. For my workflow this is critical..
 
The "CloudStorage" folder is hidden ... to find it do the following:
- Go to the Finder menu bar and select "Goto", while the pull down menu is open, press and hold the "Option-Key".
As long as you press the option key, a "Library" entry is visible.
- Klick on "Library" to open the hidden Library folder.
- In this folder you will find the "CloudStorage"-Folder.
- Drag&Drop this folder into the Spotlight-Dataprotection area as mention before.
- Done.

You're not getting me. I understand how to get to that folder (what @mbender71 called the "real/hidden copy" of the OneDrive folder). What I'm confused about is what he's referring to as the "soft link version" of the OneDrive folder. He seems to be referring to the folder he had just said to delete, yet then how could Spotlight index a deleted folder? But if he's not referring to that folder, then what is he referring to? As you can see from my screenshot, there is no other OneDrive folder in my home directory. Hopefully mbender71 will chime in eventually and clarify.

BTW, on my 2020 M1 Mac Mini right now, I can access some of my OneDrive files using command-space Spotlight search, but not others. I did NOT have the aforementioned OneDrive folder added to my Spotlight privacy list because although that had seemed to work a while back when I tried it, one day all of a sudden I was unable to get any search results from my OneDrive folder until I removed it from the privacy list (which is how it should work). I just added it back to the privacy list now, but it makes no difference in which files I'm able to access or not using command-space (but so far I'm still getting search results . . . though that may change after a while).
 
Last edited:
You're not getting me. I understand how to get to that folder (what @mbender71 called the "real/hidden copy" of the OneDrive folder). What I'm confused about is what he's referring to as the "soft link version" of the OneDrive folder. He seems to be referring to the folder he had just said to delete, yet then how could Spotlight index a deleted folder? But if he's not referring to that folder, then what is he referring to? As you can see from my screenshot, there is no other OneDrive folder in my home directory. Hopefully mbender71 will chime in eventually and clarify.

BTW, on my 2020 M1 Mac Mini right now, I can access some of my OneDrive files using command-space Spotlight search, but not others. I did NOT have the aforementioned OneDrive folder added to my Spotlight privacy list because although that had seemed to work a while back when I tried it, one day all of a sudden I was unable to get any search results from my OneDrive folder until I removed it from the privacy list (which is how it should work). I just added it back to the privacy list now, but it makes no difference in which files I'm able to access or not using command-space (but so far I'm still getting search results . . . though that may change after a while).
Let's start from the beginning ... have you the OneDrive connector app installed?
Do you see the cloud symbol in the menu bar?
 
Let's start from the beginning ... have you the OneDrive connector app installed?
Do you see the cloud symbol in the menu bar?

Of course, otherwise I wouldn't be able to access the files as I was talking about in the post you just replied to.

Look, I appreciate that you're trying to help, but you're clearly not understanding my question, I will just wait for the user that I was replying to (mbender71) to reply back with an answer since he's the one that made the post I had questions about.
 
  • Like
Reactions: Prince_Charm
This method + rebuild the Spotlight index seems to work for the Spotlight search but it breaks the mac search (option + command + space)…
can you open onedrive enclosing folders with CMD + enter in spotlight?
 
The "CloudStorage" folder is hidden ... to find it do the following:
- Go to the Finder menu bar and select "Goto", while the pull down menu is open, press and hold the "Option-Key".
As long as you press the option key, a "Library" entry is visible.
- Klick on "Library" to open the hidden Library folder.
- In this folder you will find the "CloudStorage"-Folder.
- Drag&Drop this folder into the Spotlight-Dataprotection area as mention before.
- Done.
How does this fix things? This is literally excluding the folder from Spotlight search. After I do this, the files don't even show up in Spotlight anymore. Which doesn't help the issue of not being able to open them from Spotlight.

If there's an implied step of "After clicking Done, remove the folder from the exclusion list" step, that should be made clear.

Talking about Dropbox btw.
 

In short, macOS is forcing Dropbox to move its folder location to ~/Library/CloudStorage. The problem is that however this works, Spotlight seems broken after the Dropbox upgrade. It can find files I've opened before stored in Dropbox but it can't open them. I can't even Command click on Spotlight results to take me to the file in Finder, and I can't search for the files in Finder, either. So…how the heck is this supposed to work?
 
I am not using OneDrive, but Dropbox uses the same storage at ~/Library/CloudStorage. I have all my folders marked as "Always keep on this device" and spotlight indexes them correctly. Note Spotlight can't index the content if the file is not there!
Where do you mark folders "Always keep on this device"?
 
For Dropbox it is right click and "Make available offline". I was confusing OneDrive and Dropbox - different phrase, same meaning.
Got it, thank you.

However, that still hasn't fixed my issue. I have done "Make available offline" for a particular folder, and when I search for a file in that folder its name shows in Spotlight, but clicking it just closes Spotlight and doesn't open the file. So not sure what is going wrong here.
 
However, that still hasn't fixed my issue. I have done "Make available offline" for a particular folder, and when I search for a file in that folder its name shows in Spotlight, but clicking it just closes Spotlight and doesn't open the file. So not sure what is going wrong here.
I find Command-Space Spotlight to be inconsistent. Try using Search inside Finder. Both use the same index.

Search in Finder finds any file when search is by name. Search by content works when the file is stored locally in ~/Library/CloudStorage. This seems reasonable and is consistent in all my tests. Files open as expected.

BUT, the search scope needs to be "This Mac". It does not work if the the search scope is Dropbox or OneDrive. This also apples to HoudahSpot which uses the Spotlight index.

I have not had to do any messing about removing and adding CloudStorage to Spotlight index.
 
Last edited:
I find Command-Space Spotlight to be inconsistent. Try using Search inside Finder. Both use the same index.

Search in Finder finds any file when search is by name. Search by content works when the file is stored locally in ~/Library/CloudStorage. This seems reasonable and is consistent in all my tests. Files open as expected.

BUT, the search scope needs to be "This Mac". It does not work if the the search scope is Dropbox or OneDrive. This also apples to HoudahSpot which uses the Spotlight index.

I have not had to do any messing about removing and adding CloudStorage to Spotlight index.
Dropbox literally advises during the "upgrade" that searching in Finder will not work - and I can confirm it doesn't show any results when I search in Finder for known file names there. Whether it's "This Mac" or otherwise, unfortunately.

EDIT: Perhaps I spoke too soon or Dropbox changed something. For whatever reason, I am NOW able to search—at least in Finder—and it does not matter whether I click "This Mac" or "Dropbox" when I'm in the Dropbox folder. It does show all my files correctly.
 
Last edited:
  • Wow
Reactions: osplo
Dropbox literally advises during the "upgrade" that searching in Finder will not work - and I can confirm it doesn't show any results when I search in Finder for known file names there. Whether it's "This Mac" or otherwise, unfortunately.

But that can't be so... that renders Dropbox unusable for me and for all.

No search, no way to find your own stuff!
 
But that can't be so... that renders Dropbox unusable for me and for all.

No search, no way to find your own stuff!
Yeah, I would hold off for now on the upgrade if you can. I chose to opt into the beta and wouldn't have if I'd known about this bug.

Searching in Finder works for now, but searching from Spotlight—the only way I really search for stuff on the fly—is badly broken. Heard a rumor on the Dropbox forums that macOS 13.3 fixes this, but that's in beta and I'll believe it when I see it.
 
  • Like
Reactions: osplo
See my post #64 explaining why this doesn't fix things for me.
Have you tried it? Exactly as described? Without removing the exclusion?
The trick is, that you force Spotlight to search in the "mirrored" area (not sure how to describe the "soft links" better) in the user folder but not in the folder, where OneDrive is moving the data physically. (Library folder)

edit: Just seen, that you are talking about DropBox. This might be different to One-drive. My comments talk about OneDrive behavior only. Sorry
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.