Drag'n'drop from DevonThink – Can I configure the content of notes?

I’ve a lot of research material in DevonThink that I want to start to use in Tinderbox. For the most part, and in the context of this questions, the stuff in DevonThink are different kind of textnotes, a mix of markdown, rtf and plaintext.

  1. The notes are dragged into a container with a prototype. The note created is assigned with this prototype, but none of the prototype’s attributes are used in the new note. Why not?
  2. I had created a user attribute called DevonThink in Tinderbox. My idea was to copy-past the item link form DevonThink into that field. But using Drag’n’drop, the same link is instead added to the attribute URL. My plan was to use URL for external links, and Devonthink to items in my database. Would it be possible to change the attribute used when doing a drag’n’drop from Devonthink?
  3. As it is now, if I edit a note in DT or Tinderbox after import by drag’n’drop, there is no links between the applications. This is good for now, but I can think of situations further down the road where I would like edits I do in an imported note from Devonthink to be edited in Devonthink as well. Is there a setting that allows for this?

1: I believe you’re not inheriting key attributes because the import sets the key attributes of the imported note explicitly. You can remove this assignment, or change $KeyAttributes to whatever you prefer, in your OnAdd action.

  1. Copy $URL to your user attribute $DevonThink with an action, or an agent action, or a stamp.

3: $AutoFetch will periodically update the Tinderbox item to reflect changes in DEVONthink.

This stamp or action should do what you want (assuming you’ve set the prototype already):

$DevonThink |= $URL;
$URL = ;
$KeyAttributes = ;

Key attributes are the selected attributes assigned to a note that is displayed in the top of the notes pane, right above the content?

I tried to add that code to the OnAdd for the prototype but it didn’t work. Should it?

No, it goes in the OnAdd for the container that you add the notes to.

1 Like

Thanks. But what’s the logic behind that? Why on the container?

Because you add the note to the container.

The OnAdd action is an action the container takes when a note is added to the container or dragged onto an adornment.

The OnRemove action, conversely, is the action the container takes when a note is removed from the container or dragged away from an adornment.

Thanks. The following works, moving the auto-added URL attribute to $DevonThink attribute and defining what key attributes I want to display above the text area.

$Prototype="pQuotes";
$DevonThink |= $URL;
$URL = ;
$KeyAttributes = "DevonThink;Technology;Context;Topic;Sentiment;Used"

But: When I use this code as the OnAdd action for the container, the notes I create by drag’n’drop from DevonThink are empty. The title is set, but the content isn’t added to the note.

If I remove

$URL = ;

from the OnAdd, the content is added to the note.

Why is that?

Noticed another strange behavior (at least compared to what I would expect): If I have selected two or more notes in Devonthink and drag them to Tinderbox, the OnAdd actions are only applied to the first.

The URL’s value on DEVONthink notes point to the original, and when Tinderbox sees an x-devonthink-item:// format in $URL, it will fetch the content. Fetching the content might take a while. So by zeroing-out the value of the URL you’ve erased the address that Tinderbox needs. It doesn’t know this is a dragged-in DEVONthink note, and does nothing. In other words, don’t remove the value of URL. Create different URL-type attributes for your other links.

The stamp, above, is not a great idea for notes dragged from DEVONthink.

I’ve been wondering how I can get notes from DT to TB without pulling in the content as $Text… so I’m glad I learned something here :slight_smile:

If @thoresson wants to keep the DEVONthink url in its own field, that works fine… just drag them into a container that doesn’t have the $OnAdd which unsets the URL, and then move them into the right place.

TB has always fetched the DT content right away for me, but I’ve also never had an action which immediately unsets the $URL…

We’ll investigate the question of the application of OnAdd to a multiple drag.