Applying onaction from container for dragged devonthink files

Apologies if this issue belongs in the inter-app workflows but figured this was a basic enough for here. I also read throughthis thread but couldn’t figure out how to address the following:

I have a container with an onaction to assign prototypes of notes I drag into it from other apps (i.e. a text file from day one, individual notes from mac notes).

a key part of the prototype is for specific attributes to display - in this case $container & $path and in other cases a user-created attribute I named $citation

Issue 1:

It is working fine so far except for when I drag text files directly from DevonThink - When I drag from devon think into the container, the visual aspects of the dragged note follow the prototype but the attributes do not and instead show up as:

URL
Source Modified
Source Created

If I drag the text file out of DevonThink onto the desktop and from desktop into the container - the onaction works fine (although I then lose the link to DevonThink and it adds an extra step)

issue 2:

the text of the original file from DevonThink does not show up in the note that is dragged from Devon into Tinderbox - I know I can copy and paste the text into the note but that seems to be an extra step.

What am I missing or what can I do to drag directly from DevonThink and have the prototype applied to the note with the desired attributes displayed?

Thank you!

I think I see the problem. If you look here, you will see that in response to user requests, Tinderbox does some extra handling of dragged DEVONthink notes. In the linked article it notes:

(v7.2.0+). Using DEVONthink Office Pro 2.9.15+, the note created imports the DEVONthink Creation time as $SourceCreated and the DEVONthink Modification time as $SourceModified.

I think that this setting of DT-specific Key Attributes ($KeyAttributes) happens after $OnAdd is fired. In my tests the DT note gets the prototype intended in the Container’s OnAdd but the latter’s $KeyAttributes value is then overwritten (and set locally) for that note.

As thinks stand, the best workaround is to make a stamp in your document, with this code:

$KeyAttributes=;

After adding the DT note(s) into your container, select the note and apply the stamp. This resets $KeyAttributes to use the prototype-inherited layout and not that set via the DT drag process. Note: this does not change the data set in $URL, $SourceCreated and $SourceModified for the DT-dragged note - it simply isn’t seen (unless your prototype uses any of those 3 attributes in its KAs).

A fix as you request isn’t possible without changes to the app. I’ll flag this up in a different channel.

Thanks, @mwra - I’ll work on the stamp – do you have any sense of why the text in the Devon note is not retained when the note is dragged into TBX? Right now I’m having to copy and paste it in.

What kind of document is the “Devon note”? Text, PDF, Office, something else?

Plain text and RTF can (and do, for me) carry over their “text” to Tinderbox when the documents are dragged into 7.5.x

Be aware that DEVONthink is not always consistent in adding extensions to files shown in the client, or even stored internally in the database. So make sure your documents have the correct extensions.

Thanks - I’m not sure what I did but the text carry over seems to be working now.

For whatever it is worth to @eastgate @mwra - I would appreciate the ability to drag from DT to TBX and have any onactions apply to the DT note rather than (or in addition to) getting the Source info that get added to the imported note. Thanks @mwra for offering to flag in a different channel.

I’m new to TBX and still figuring it all out but so far really enjoying how it can be a part of my workflow.

[N.B. I’m just a user/volunteer not formally part of Eastgate]

A fix to the OnAdd collision has been tested, whereby the document’s OnAdd is applied and the drop simply sets the previous attribute values (as above) but has no effect on OnAdd. I presume this will appear in a subsequent release. For now the fix is as suggested above.

1 Like