The feature in DEVONthink’s where you can select a document, right-click and choose “Copy Item Link” is very handy, as is the ability to copy a link to a particular page in a document by choosing “Copy Page Link”, or a to copy a link to a particular line in an RTF document by choosing “Copy Paragraph Link”.
These links are very useful, especially since they “move with” the document if it’s moved to a different group within the same database (correct me if that’s not always right).
But using these links will cause the document to open in a separate DEVONthink window, Often I don’t want the document to actually open in a separate window; instead, I just want to go to the document (or in the case of a page link or line, to the specific page or line).
For this I know you can add ?reveal=1
onto the end of the copied item link, or “&reveal=1” onto the end of a copied page or line link, and the resulting link will just go to the document, or to the specific page or line.
Because I use these links a lot, and because more often than not I don’t want the linked document to open in its own window, in the case of “Copy Item Link” I add ?reveal=1
onto the end. In the case of “Copy Page Link” or “Copy Paragraph Link” I add &reveal=1
onto the end (since there’s already one query string parameter).
But having to do that manually isn’t efficient. To (sort of) get around that I wrote an AppleScript which appends the appropriate thing according to what was just copied by the right-click menu action:
set theData to (the clipboard as text)
set pageFlag to "?page="
set lineFlag to "?line="
if (theData contains (pageFlag)) or (theData contains (lineFlag)) then
set the clipboard to (get (the clipboard) & "&reveal=1")
else
set the clipboard to (get (the clipboard) & "?reveal=1")
end if
set d to (get (the clipboard))
display dialog d with title "Copied"
But even with this, one still has to copy the link and then select the script command, making two actions. And it’s a bit messy, relying on the clipboard not changing between two separate actions which must be contiguous.
It would be better if an option to append the appropriate “reveal” was coded into DEVONthink, such that, if a modifier key (like option) was pressed whilst right-clicking and selecting “Copy Item Link” or “Copy Page Link” or “Copy Paragraph Link”, the copied link would automatically append the ?reveal=1
or the &reveal=1
, appropriately, in one go.
Apologies if this already exists and I missed it.