How do I prevent TB to fetch the contents of PDFs when dragging 'n dropping from Devonthink

Dear all, as a complete newbie on TBX (in fact still waiting for my order to be processed, perhaps it was not the smartest move to place it today :slight_smile: ) I have a workflow where I archieve all my links for presentations as pdf&text in Devonthink.

I created a note as prototype, with an action
$Text="";

I have the impression this works sometimes. In fact it works when drag/drop single items from devonthink and afterwards the text-field is empty.

If I drag more than one (in this testcase 6 items, 1 formatted text, 5 pdf&text with sizes between 1,2KB and 1.7MB) make Tinderbox unusable by showing the beach ball for minutes and again on every click on one of the notes.

Ok, this is a MacBook (Retina, 12-inch, Early 2016 1,1 GHz Intel Core m3) for travelling, but clearly the workflow doesn’t work. If I understand the solution given above correctly the idea is to let TBX import the stuff and afterwards delete it with an agent. If what I did is somehow correct that doesn’t even work for a test-sized amount of data, I can not imagine what the result shall be with some serious stuff.

Could someone please help me understanding better where my error is, because Rene seems to be satisfied, so obviously there is a working solution.

Best regards
Mitch

It’s not completely clear what you are looking to achieve. I assume (probably incorrectly) that you want to create Tinderbox notes that link to the original document in DEVONthink without importing the contents?

Respecting Rene’s suggestion, there is a way without a lot fuss, the simplest way IMO: Copy the item link of the DEVONthink record (Edit > Copy Item Link) then use Paste in an Outline or Map in Tinderbox to create a note whose URL is the link back to the DEVONthink item. This method gets you the Tinderbox note you want, and no contents are imported.

Since then I’ve come around using a stamp when dragging & dropping a single pdf from DT to TBX (I also use this stamp when applying the method outlined by @PaulWalters above).

I have not found a solution to speed up the import of multiple pdfs (eg to prevent the fetching). Unfortunately, the idea with an $OnAdd action such as:

$dtURL=$URL; $URL=;

did not work for me. It seems that as soon as you add a file to TBX the big fetching starts. My main machine is a mid-2013 MBA 11", so I definitely feel your pain.

Copying the item link and pasting that works like a charm, but unfortunately that solution doesn‘t scale. If you have to do that for hunderds of items it becomes boring pretty fast. Devonthink doesn‘t offer the option IMHO to copy links to more than one item simultaniously. And dragging/dropping more than one item results in notes where the textfield contains the pdf—source—code.

in addition every usage of one of those notes with the pdf—content in the textfield makes the pc unasable again for quite some time. The beachball of death being my best buddy…

Then use this script. See

2 Likes

Thanks, this is really helpful!

It would be nice if on the Devonthink side they allowed copying multiple links at a time. I use the on one at a time method to create summary notes that reference documents. Since I’ve been using TBX for many years, I’m very reluctant to embed any media files into the TBX file.

The easy way to do it is to select multiple DTP items and then use the contextual menu “Create Table of Contents”.
That creates a new note with clickable links. That note can be dragged into a TBX note providing links back to the documents, but as links with the names of files, not the plain URL links. Nicer for some uses.

You really should give the above script a try, works great for me.

Yes

After creating the TOC document in DEVONthink, which is an RTF, I suggest selecting all of its text and changing the List style to “none” so that the contents no longer is indicated with “1.”, “2.”, etc., Then copy and paste the TOC into a Tinderbox note. Afterward, you can explode the note to get a new note for every TOC entry and use a stamp to set $URL=$Text. Note: this stamp will not work. I’ll post one that does, later.

If you do not need a lot of notes, then it also works to select a URL in a Tinderbox note and drag the URL into the Outline, which creates a new note with $URL linking back to DEVONthink.

Hi Paul, thanks for that great piece of code, works like a charm.

In addition, James proposal with “Create table of contents” is a nice shortcut if only the links are needed.

Thanks a lot to all of you, great support here for newbies :slight_smile:

I was really hoping that this would somehow parse the RTF link and put that in the $URL, but it doesn’t for me. If the line of text is “tinderbox forum” and the RTF link is http://forum.eastgate.com then $URL gets set to “tinderbox forum” and is not clickable.

Am I doing something wrong?

No, I was doing something wrong by suggesting that stamp.

What actually works is to drag the RTF link from $Text to $URL – which loads the x-devonthink-item:// link into $URL.

I need to go back to the drawing board on the the stamp. Something using RunCommand will work. More later.

Ah yeah using something like nokogiri to parse the URLs would work nicely.

Tinderbox is not rendering the RTF links as HTML links when setting up an HTML export template. I thought it used to… but I also haven’t imported much RTF into Tinderbox, so maybe I’ve just used Make Web Link...

Do we expect the links from imported RTF text to be converted to HTML links on HTML export?

We might be wandering into another topic and I suggest posting this as a separate thread – just so other readers can locate it later.

I don’t know the answer, but I don’t know that I’ve ever tried this either.

For those who have TextSoap (IMO, everyone should have TextSoap :smile:) – select the text of the imported TOC document, and use TextSoap’s Extract URLs by Replacing cleaner to convert RTF links (as in the TOC document) to their original URLs.

These, of course, are all effective at getting rid of the content after it’s been imported. But, they do not prevent the content from being imported itself. This is not much of a problem when the PDFs are small, but is if they are large. It also seems like a waste to have the same information (i.e., the PDF content) ending up i two places (i.e., DT and TB). Would there perhaps be a way to only create a note that has the name of the DT item and its url when, for example, dropping with the option key pressed?

You can always make a note yourself and assign the DEVONthink URL to the note’s $URL.

Upon further consideration, I’m inclined to agree:

  1. It makes sense for Tinderbox to import the text of short pdf items.
  2. It is not particularly useful to import the text of very long pdf items.

Two design problems now confront us:

  • Where do we draw the line between “short” and “long?” (My suggestion: 2000 words. Other ideas?)
  • What (if anything) do we do to indicate that we chose not to import a long text. (For example, might we import just the opening paragraphs?)
1 Like

I am so happy to see this is took into consideration. It’s amazing how dragging “a few” DTP items with approx. 5 pages long PDFs or Websites printed as PDFs can render Tinderbox on my new iMAC unusable for quite some time.

But to answer your question: Do you really want to walk the path to let the user define the threshold between long and short? I would consider a switch PDF import yes/no as more than I dared to ask. Of course zero<value<unlimited is also ok, as long as zero is an option?