HI
I love DT and moved to it years ago form Evernote. However, the format of the links to items has been problematic for ages for me.
Basically links to Onenote or Evernote times work from anywhere, but the DT x-devonthink-item://8C38F943-A731-44A3-A52D-0BB2B81AA5FA. the format is not recognised by a lot of apps
i use Clickup (App on my mac, not the web interface) for planning and need to be able to link to DT imtems, but cannot. (I have tried 20 management apps and of those 2 work with the DT links and i don’t want to use either of them)
Is there a way to do this? (maybe copy the link from Clickuop to the clipboard and then run a service or script with a keyboard shortcut?
Or select the link text and run the service or script with a keyboard shortcut?
Support for other URL schemes is added by the developers of those applications or services. I would make a feature request of whatever app you’re referring to.
Depending on what Clickup can actually link to, Hook might be a solution. Amongst other things, Hook can make a hook file which can contain any valid URI, so, e.g. an x-devonthink-item. The hook file itself resides in Finder like any other file, and is parsed through Hook to call the URI whenever it (the file) is opened. (Workflow: call Hook from DT with the document in question highlighted, select Make Hook File, select appropriate hook file from Clickup).
-- Open selected rich text link(s)
-- Note: This script uses macOS's System Events.app to copy selected text so it may be that you have to increase the delay if you use it via shortcut (e.g. via Alfred or Keyboard Maestro) as there’s a chance that once in a while you don’t let your triggering shortcut go fast enough which will let macOS register your shortcut plus the shortcut System Events presses.
property theDelay : 0.2 -- see note above
try
delay theDelay
tell application "System Events" to tell (first process whose frontmost is true) to keystroke "c" using {command down}
set theGrepResults to do shell script "osascript -e 'the clipboard as «class RTF »' | perl -ne 'print chr foreach unpack(\"C*\",pack(\"H*\",substr($_,11,-3)))' | egrep -o 'x-devonthink-item[^\"]*'" -- https://superuser.com/a/1409995/
on error
display alert "No text selected or no link(s) found" buttons {"Ok"} default button 1 message "" as critical
return
end try
set theGrepResults_list to paragraphs of theGrepResults
set theRefURLs to {}
repeat with thisGrepResult in theGrepResults_list
set thisGrepResult to thisGrepResult as string
if thisGrepResult starts with "x-devonthink-item:" then
set thisRefURL to characters 1 thru 56 in thisGrepResult as string
if thisRefURL is not in theRefURLs then
do shell script "open " & quoted form of thisRefURL
set end of theRefURLs to thisRefURL
end if
end if
end repeat
I never heard op PopClip too, it looks like a nice tool!
I do not have experience with ClickUp, but I do find it strange that you cannot use URL schemas in it. A lot of Mac Apps use URL schemas like DT has. You have solved this by using PopClip, but maybe also ask the ClickUp developers to allow a wider range of URL’s.
I first missed to carefully read PopClip’s documentation, especially the part about modifiers. Years later I stumbled across it again and couldn’t believe what this tool can do. With the great documentation and some time it’s doable to add modifiers to nearly every extension. No more avoiding valuable space for extensions that do only one action.
I have been experimenting with these solutions in Evernote 10.25.6, and have found that PopClip’s behavior is a little uneven, to say the least. And as noted, it will only work with raw X-DEVONTHINK- ITEM links, not with Evernote’s own hyperlinks (as it invariably inserts http:// before anything that is not a FILE URI).
I’m wondering - how hard would it be for DT developers to create a redirect extension for Chromium or Mozilla browsers to intercept DT’s item link URIs from Evernote or other apps, and send them back out to DT Pro 3? I’ve looked at other redirect extensions, especially Requestly – and though I’m not sure it provides a direct fix, it does allow script execution…which might get around the Electron app problems that (I’m told) are at the root of “new Evernote’s” weaker integration.
how hard would it be for DT developers to create a redirect extension for Chromium or Mozilla browsers to intercept DT’s item link URIs from Evernote or other apps
It would be likely be much easier for the other developers to “create a redirect extension” given the size of their team versus ours.
And as noted, it will only work with raw X-DEVONTHINK- ITEM links, not with Evernote’s own hyperlinks (as it invariably inserts http:// before anything that is not a FILE URI).
You can extend PopClip’s recognition of other URL types.
Quit PopClip
Open Terminal.app and paste defaults write com.pilotmoon.popclip OtherURLSchemes -array hook x-devonthink-item otherapp
I guess my broader question would be: given the key role DT plays in the PKM space, and the importance of bidirectional linking, interoperability, integration, etc…could this kind of development be considered with a higher priority? I imagine there are a number of popular apps that don’t recognize DT item link URIs. If most or all of them end up bouncing the link to the default browser, would a redirector solution not be a fairly economical way to handle them? You’d potentially get a big boost in integration (with one of DT’s most excellent features) for a relatively modest time investment.
Obviously, I’m making a lot of assumptions there - but I think it’s important to note that breakdowns in integration end up eating a lot into the time that these apps are supposed to save us. It’s not DevonThink’s fault by any stretch of the imagination – but this phenomenon does erode the user’s confidence in the ultimate functionality and compatibility of the tools.
Easy workaround for users of ClickUp: TinyURL. It’s web-based, but so is ClickUp.
I presume other URL shorteners would work or your own, depending on your security model. Plop in DT link, make your web link, drop web link into ClickUp, ClickUp can’t be fussy with your URL.