Publish from Tinderbox to DEVONthink

I’ll try again to explain the HTML errors that appear in the file. First, I added a text link to the top level note “Publish to DEVONthink” in the text of the note “Links between notes become DEVONthink links”. Then I published the first note, and then I published the second note – separately.

The link that now appears in the HTML for the second note (“Links between notes become DEVONthink links”) is

<p>This is a link to <a href="../x-devonthink-item://2D3A180D-60A1-41E4-9AF9-F7F33BE5490F">
Publish to DEVONthink</a></p>

which DEVONthink interprets as a nonsensical link to a folder inside the database package – something that could never work.

I found a bug with links to/from notes inside containers, that I think is fixed but I’m currently vetting in my own usage. The HTML you shared above looks like that’s what’s happening – thanks for sharing that.

Does it work properly if you only link to/from top-level notes?

No it does not work properly.

Here’s the full link that DEVONthink interprets from the HTML (with personal info redacted).

Internote HTML links is a longstanding problem with DEVONthink, BTW.

Hrm I’m at a loss. I uploaded a video walkthrough in case it helps. Perhaps this is what you’re already doing though…

The only other thing I can think of is that perhaps it’s a version problem. I’m running DTPO 2.9.16, Tinderbox 7.3.0, on OS X 10.10.5. Other than that, maybe there’s some DEVONthink configuration difference that I’m unaware of.

2 Likes

(Another too-long-to-be-useful post. Deleted.)

This video really helped, @pat. Thank you.

May I suggest to expand the “Publish to DEVONthink”-Stamp-Code a bit in order to place the backlink – from Devonthink to Tinderbox – into each exported note; so one can quickly return to original note in Tinderbox while working with the exported notes in Devonthink.

Code could look something like this:

action($Text("/Stamps/Publish to DEVONthink")); $URL=$NoteURL

Does this make sense? At least, it works here.

Cheers!

@PaulWalters did you try following the steps in the video? You’re running into a bug that I’ve already acknowledged. The video is just a couple minutes and shows the behavior when using top-level notes.

Try this:

  1. create two top-level notes
  2. create a text link between them
  3. publish

I’m happy to look into situations where it’s not working correctly, but first I’d like to establish a baseline. I’ve outlined simple steps above. If those exact steps don’t work for you, that’s very interesting to me.

Does that mean it worked for you, @andreas?

I like that idea… though I have some concerns about implementing it. The $URL already carries over to the DEVONthink url field. I don’t want to throw it away though if it’s there… one possibility is to move $URL to DT’s comment field – that’s what the annotate script does if a record already has a URL. I’ll think about this a bit.

Jepp, @pat, worked just as advertised :slight_smile: Thanks again

1 Like

Hi, @pat, this is impressive. Am I right in thinking that the notes will always go to DEVONthink’s global inbox and there’s no easy way to change that behaviour? (And maybe there wouldn’t really be any point in changing it?) I’m slightly wary about moving notes out of the global inbox and into different locations in different databases and still expecting links to work, but assume that once the between-document x-devonthink-item links are all fixed by reapplication of the stamp there shouldn’t be any problem—and, indeed, in my limited experimentation that has indeed been the case.

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)

Done :slight_smile: I like it

That’s correct in v0.3.0. This 0.4.0 update (linked in the original post) now respects the configuration you have set in DEVONthink’s Preferences->Import->Destination.

That’s the really cool thing about x-devonthink-item:// URLs – you can move documents between databases and the links still work. Every document has an identifier that sticks with the document. Now if you duplicate the document, it gets a new identifier, and the link points to the old one. So don’t duplicate a document and delete the old one, or else the link will break.

You don’t even need to reapply the stamp to fix the links. As long as the linked-to document has a $SourceURL beginning with x-devonthink-item:// then it will be all good.

See for yourself:

  1. download the document from the original post
  2. create a top-level note (give it the p_DEVONitem prototype), add some text, and link it to “Publish to DEVONthink”
  3. publish “Publish to DEVONthink” first, and your new note second
  4. for each one, click the $SourceURL launch button to view the record in DEVONthink
  5. move them to separate databases
  6. view your note, click the link, and you’ll be on “Publish to DEVONthink”
  7. if you use DTTG then you can sync both databases and see the same behavior…
2 Likes

Most impressive. Thanks, @pat.

Minor thing. The 0.4.0 download has numerous excess windows with a view of the same note. You might want to close all windows in the uploaded version(s).

Thanks. OP is updated with 0.4.1, which shouldn’t have all those windows anymore.

1 Like

Nope, I just don’t really use tags, so I didn’t add that functionality. This is an early-stage tool used primarily by me (and I sort of thought only me :slight_smile: )

I can look into transferring the tags over.

As far as I have tested, a simple modification to the Applescripts does the trick. In case it is of interest to other users, I post them here:

In Create DEVONthink record, I have added: tags:"^value($Tags)^",
In Update DEVONthink record, I have added: set tags of theRecord to "^value($Tags)^"

2 Likes

As long as you keep it opened here or in Github, your script is THE solution for the integration of DEVONthink and Tinderbox as far as I am concerned.

Unless they are real footnotes, I keep my sources solely in DT, referenced as web links in the $Text of my annotations. Therefore, the watched folders feature has ended up being less important in my seutp.

I use Tinderbox mostly for my own writing. With your script I can have it in DT as well. I am still to decide if in the same DT database as sources or in a different one.

So, thank you very much for sharing your script.

3 Likes

THANK so much for this script dear @pat. This has been very helpful.

1 Like

I’m glad it’s helpful :slight_smile:

fwiw, I’ve moved to a pattern of one DT export per TBX. The linking mechanism I figured out here is clever, but slow.

1 Like

Thanks a lot for the script, Pat!

Just to make sure that I don’t get this wrong: This script provides a way to publish a a personal wiki that lives inside Tinderbox. More precisely, Tinderbox is where the magic happens and the representation in Devonthink is meant to be a read-only version for convenience, correct?

Even though we have folder watching (Devonthink -> Tinderbox) and the script you are presenting here (Tinderbox -> Devonthink) the scenario you described is the above, not a true two-way synchronisation in which notes could be edited and added in either program?
(That would be so nice…)

Exactly. It’s if you want to write your notes in Tinderbox, and use DEVONthink to take them with you.

Correct.

Yep it would. It’s important to note that the stuff I provide here is unofficial, just me creating stuff using the tools at hand. It’s entirely possible that changes to Tinderbox or DEVONthink could break functionality.