x-devonthink-item links in Anki

Hi folks, here’s a quandary for you:
I’m using Anki (“the friendly, intelligent flash card app”) to study some material. DEVONthink’s item links are an asset here: I can link a PDF, point to the relevant page, and have the link work across devices so that no matter where I’m running through the flash cards.

Supposedly, anyway.

For some reason Anki’s desktop implementation seems to require… x-devonthink-item:///

Note the three slashes. Item links work just fine with two slashes from other apps (e.g., OmniFocus) and on Anki for iOS.

Naturally, three slashes don’t work on iOS.

Any ideas? The goal here is getting a single link to work across platforms. (Creating two links on each flashcard is actually a pain as different links are embedded directly in the data of ~500 some cards already created. If I had my time back I’d have saved the item reference but not the link, then I could soft-code the right link based on which device I’m using. Alas.)

We don’t support Anki, so we can’t answer this. I’m not sure what steps you took to add a link either as I’m not familiar with the software, except by name.

Good place to ask about Anki – their own forum

anki.tenderapp.com

Thanks. I have posted in the Anki subreddit, but the post was quickly buried. I suspect that the Anki community doesn’t use DEVONthink very frequently. I posted here wondering if anyone else in the DEVONthink community are using Anki.

OmniFocus links seem to always work, iOS or macOS. I suspect that’s because OmniFocus forces the three slashes requirement—i.e., OmniFocus app links fail if you only use two slashes. So is there something wrong with my setup such that three-slash x-devonthink-item links work on desktop, but not on DEVONthink To Go?

Alternatively: are there other applications where URL schemes fail with two slashes but work with three? Or is there anything I’m missing about URL scheme usage that explains this issue?

Well, a stupid solution.

[attachment=0]Screen Shot 2019-03-09 at 3.14.36 PM.png[/attachment]

I only take the item uuid and I prepend both x-devonthink-item link types to two different links for desktop and mobile. Voila, I guess.

URL schemes are independently developed, so it’s possible a developer could add a non-standard extra slash.
It’s also possible macOS supports three slashes due to native file:/// URLs, likely not native to iOS (especially with sandboxing and heightened security on mobile devices).

file:///path schemes are used because the fully qualified URI is [file://host/path](file://host/path), and when host is assumed to be localhost — your machine — the slash after localhost is kept, and we get file:///

See RFC8089 for the file URI standard, and RFC3986 for the general URI standard. (Tim Berners-Lee supposedly regretted putting the slashes in the original WWW URI as “too clumsy”. See w3.org/People/Berners-Lee/FAQ.html#etc)

OmniGroup might have used omniFocus:/// by mimicking file:/// or because it “looks UNIXy”.

1 Like