Indexing XMind Files in DevonThink: Seeking a Solution

Hello everyone,

I’m looking to improve the indexing of my XMind files in DevonThink. I’ve identified an interesting problem and I think there might be an elegant solution.

How can such a solution be integrated into DevonThink?

  • Is there a DevonThink API that would allow this integration?
  • Are there hooks or extension points designed for this type of use case?
  • Has anyone already developed something similar?

No. But as long as Xmind is properly installed, DEVONthink should use Xmind’s Spotlight plugin to index these files.

Ok my XMind must be incorrectly installed :slight_smile:

Example with a map containing “FooBar Map”. Not found in DT but fond in Spotlight

It’s not findable in DT :

While it shows up fine in Spotlight :

Please look in Finder on one of this files not seen in DEVONthink, what is the default open with app set for?

XMind

…]()

No. See the apple support article i gave to see what i am asking.

Does the issue persist after rebooting the machine then adding a new XMIND file?

Yes, I just restarted, created a new directory outside of iCloud (I have iCloud with data protection) and created a new file using XMind.

Then I ran:

sudo mdutil -Ev / 
sudo mdutil -sav 
/: Indexing enabled. 
/System/Volumes/Data: Indexing enabled. 
/System/Volumes/Preboot: Indexing enabled.

But the file remains findable in Spotlight but not in DT (DevonThink)

Does DEVONthink have Full Disk Access enabled in System Settings > Privacy & Security?

Yes

For your information, I reinstalled Xmind (new download from their website), and without entering any license codes or purchasing (a long time ago I purchased a license), I created a test *.xmind file. Imported into DEVONthinkI made no other tweaks to DEVONthink nor macOS.

See screen shot.

It also displays in Finder as expected. NOTE: Spotlight is not the software displaying the file…this a red-herring. Spotlight is only a search tool to find files that then use other software to display, e.g. Preview, Finder, using macOS QuickView (or something). All that above my pay-grade and interest.

DEVONthink 3.9.8
macOS 13.7.1

If I understand the OP correctly, they’re asking about indexing, not preview/display. Spotlight seems to find text in the Xmind files, DT does not. What do you see in this regard?

Good catch (thread long).

When I search All Databases for central topic without any quotation, the first hit is the new xmind file.

1 Like

As to

Probably, because the file name is just “central topic”. I followed the same approach as you but changed the file name to something else – DT does not find “Zentrales Thema” (I’m in the German locale).

mdimport -d3 tell me this:

kMDItemTextContent = "Hauptthema 1\nHauptthema 2\nHauptthema 3\nHauptthema 4";
kMDItemTitle = "Zentrales Thema";

So, the text of the central blob is used for the kMDItemTitle attribute, and the other strings are stored in kMDItemTextContent. Both are found by mdfind and the interactive Spotlight search (where the relevant result appears far down the list).

I think that DT should in any case use the kMDItemTitle attribute, and according to the Scripting Dictionary, the metaData attribute should reflect that attribute. But I suppose it doesn’t do that for all types of files (why not?).

Would that be considered a bug? An incomplete feature? @cgrunenberg would know.

As to the kMDItemTextContent attribute – well, that’s a very peculiar thing. In Apple’s words:

Applications can search for values in this attribute, but are not able to read the content of this attribute directly.

Which (kind of) answers @oscille’s original question: There’s no way for DT to get at the other strings in your Xmind files (short of parsing the XML, which is probably a bad idea performance wise). Not even mdls will tell you anything about kMDItemTextContent. Supposedly for privacy reasons – if the attribute were accessible like that, every app on your machine could read every other app’s files content at will. Not necessarily a good idea.

There’s also a thread on Stack Overflow on that topic:

Yep. That didn’t occur to me. Well spotted, yet again. Time for more morning coffee!

The issue is caused by an internal ID of Xmind’s Spotlight plugin. DEVONthink handles these IDs case sensitive so far but Xmind uses a lowercase ID whereas the SearchKit of macOS (used to load these plugins) prefers uppercase. In the end this conflict causes the issue but the next maintenance release of DEVONthink will be able to handle this.

5 Likes

Thank you for this answer