Warning: This is beta software!
It does the job fine for me, but is still a bit rough around the edges. If you don’t understand how it’s built, you might get confused. Ask for help on the forum and I’ll do my best to help you out.
I love taking notes with Tinderbox, don’t you? It gives me a nice structured way of looking at information, and then I can export it to take it with me or share it with others.
Ever since DEVONthink To Go was released, I’ve wanted to use it to take my Tinderbox notes with me. So I run File->Export->as HTML
, index the folder in DEVONthink, and off I go, right? Not quite…
There’s one key problem that prevents me from effectively taking my Tinderbox notes on the road:
Indexed folders in DEVONthink kind of suck, unless that’s what you really want.
You’ve got a giant Bookends library that you want to search with DEVONthink? Great, index the Bookends folder. Just don’t bother using DEVONthink’s Copy item link feature. As soon as you move or rename a file on disk, the x-devonthink-item://
link breaks. And I love those links! You can add them to your task manager and calendar, and they always take you to the record you want – if it’s an imported record. So how do you make that work with Tinderbox?
Take notes in Tinderbox. Publish to DEVONthink. Maintain the link.
Publishing from Tinderbox to DEVONthink is easy, with the code provided in this document. With it, you can:
- press one button to publish a note from Tinderbox to DEVONthink
- automatically link the Tinderbox note to the created DEVONthink record
- update your DEVONthink records with the press of a button
- file the record wherever you like in your DEVONthink database
- use the
x-devonthink-item://
link anywhere you want, confident that it will always work
Two ways to publish
1. The quick-start method (just edit this document!)
The quickest way to publish from Tinderbox to DEVONthink is to simply use this document. Add a note and enable its $PublishToDEVONthink
attribute (the p_DEVONitem
prototype has it enabled by default). Then run Stamps->Publish to DEVONthink
. If everything goes well, DEVONthink will have a new HTML record and your note will now have its $SourceURL
attribute set to the x-devonthink-item://
URL. Click it to open the record in DEVONthink.
2. Publish from existing documents
Already have a document with a bunch of notes in it? No problem. It’s a little bit more involved than the quick-start method, but it should still only take a few minutes. Here’s what you do:
- Add a boolean user attribute named
PublishToDEVONthink
- Make sure you have an HTML template defined (you can use
File->Built-In Templates->HTML
if you don’t have any) - Add the
Code
prototype:File->Built-In Prototypes->Code
- Copy the
Stamps
container into your document - Copy the
Applescripts
container into your document - Create a stamp with the following action code:
action($Text("/Stamps/Publish to DEVONthink"))
Run the stamp on your note!
What gets published
-
$Name
-
$URL
- HTML representation of the note, as defined by
$HTMLExportTemplate
property
If you make changes to your note, you can update the record in DEVONthink simply by publishing the note again.
Links between notes become DEVONthink links
One of my main goals with this project is to build a personal wiki with Tinderbox – and then take it with me wherever I go. To do that, the pages need to be able to link to one another… which is precisely what this document does.
Assuming that you have published your notes to DEVONthink, any links will automatically be converted to x-devonthink-item://
links.
For this to work, you may need to publish your notes twice.
The first pass imports the note into DEVONthink. This sets $SourceURL
on the note. Before a note has a $SourceURL
, any incoming links will not work in DEVONthink. Here’s an example:
- Note A links to Note B. Neither has been published to DEVONthink.
- Publish Note A. The link to Note B will not be converted to a DEVONthink link, because Note B has not been published and does not have a
$SourceURL
- Publish Note B. It now has a
$SourceURL
. The published DEVONthink record for Note A still has a broken link, because it was published before Note B. - Publish Note A again. It picks up the
$SourceURL
from Note B, and the published DEVONthink record has a workingx-devonthink-item://
link
The simplest solution is to publish all your notes twice each time you add or link new notes.
I hope to improve this functionality in the future to make it faster and more automatic.
Possible issues
There are probably some edge cases, and for now it’s best to only publish top-level notes with distinct names. But it’s working well for me so far…
Implementation note
To get this working quickly, and to minimize the number of steps required to make this work for existing documents, the x-devonthink-item://
linking functionality uses $MyString
as a temporary storage area. If you have agents that suddenly go out of whack, it may be because they’re relying on $MyString
. I’ll see what I can do to avoid using it in the future.
Performance concerns
I use find()
to look up all the notes that have been published to DEVONthink. Then I iterate through them and replace the exported paths with the x-devonthink-item://
URLs. This is a lot slower than just looking for the links that are in the note itself. But I think that’s the only way to support links that are provided by child notes.
Version history
0.4.0
- NEW Add
$PublishToDEVONthink
attribute for explicit publish selection - NEW Set DEVONthink’s URL field to Tinderbox note link (forum request)
- FIX Linking to and from notes in containers
- FIX Link issue when publishing from aliases
- FIX Respect DEVONthink’s import destination configuration (forum report)
0.3.0
- Replace all exported path links with DEVONthink links when possible – this supports links generated by agents,
^include^
,^linkTo^
, etc
0.2.0
- Replace path-based text links with DEVONthink links – e.g.
<a href="Publish_to_DEVONthink.html">Check it out!</a>
becomes<a href="x-devonthink-item://919FE3FC-88CD-4E6A-804A-F4DDA4F2C114">Check it out!</a>
0.1.0
- Basic publish to DEVONthink functionality
Upcoming Development
- Delete from DEVONthink
- Tooling to update an existing document
- Stamp to check for necessary infrastructure
- Stamp to update components (stamps, applescripts, prototypes)