# Challenges with the automatic “RTF to Markdown” converter \[solved in DEVONthink 3.8\]

**URL:** <https://discourse.devontechnologies.com/t/challenges-with-the-automatic-rtf-to-markdown-converter-solved-in-devonthink-3-8/62896>\
**Category:** DEVONthink\
**Created:** [March 11, 2021, 12:30pm UTC](https://discourse.devontechnologies.com/t/challenges-with-the-automatic-rtf-to-markdown-converter-solved-in-devonthink-3-8/62896 "2021-03-11T12:30:51Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![svsmailus](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/svsmailus/32/4839_2.png) [@svsmailus](https://discourse.devontechnologies.com/u/svsmailus)\
**Post date:** [March 11, 2021, 12:30pm UTC](https://discourse.devontechnologies.com/t/challenges-with-the-automatic-rtf-to-markdown-converter-solved-in-devonthink-3-8/62896/1 "2021-03-11T12:30:51Z")

</div>

I’m copying urls dnd pasting them in DEVONthink in a markdown document. However the pasted url escapes the “:” character with a slash. How do I stop this occurring?

---

<div class="post-metadata">

**Author:** ![cgrunenberg](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/cgrunenberg/32/7172_2.png) [@cgrunenberg](https://discourse.devontechnologies.com/u/cgrunenberg)\
**Post date:** [March 11, 2021, 1:15pm UTC](https://discourse.devontechnologies.com/t/challenges-with-the-automatic-rtf-to-markdown-converter-solved-in-devonthink-3-8/62896/2 "2021-03-11T13:15:52Z")

</div>

Which version of DEVONthink do you use and how did you copy the URL? E.g. I couldn’t reproduce this with a URL copied in Safari. If the clipboard contains rich text, then it’s converted to Markdown. Edit \> Paste & Match Style or Cmd-Shift-V can be used to avoid this.

---

<div class="post-metadata">

**Author:** ![svsmailus](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/svsmailus/32/4839_2.png) [@svsmailus](https://discourse.devontechnologies.com/u/svsmailus)\
**Post date:** [March 11, 2021, 3:07pm UTC](https://discourse.devontechnologies.com/t/challenges-with-the-automatic-rtf-to-markdown-converter-solved-in-devonthink-3-8/62896/3 "2021-03-11T15:07:48Z")

</div>

Thank you! Paste and Match style works. How can I make the default that what I paste remains what I copied with no coversion?

---

<div class="post-metadata">

**Author:** ![cgrunenberg](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/cgrunenberg/32/7172_2.png) [@cgrunenberg](https://discourse.devontechnologies.com/u/cgrunenberg)\
**Post date:** [March 11, 2021, 3:19pm UTC](https://discourse.devontechnologies.com/t/challenges-with-the-automatic-rtf-to-markdown-converter-solved-in-devonthink-3-8/62896/4 "2021-03-11T15:19:48Z")

</div>

This is not possible but usually copied URLs do not contain style and are therefore not converted (see my tests with Safari). Which app did you use to copy them?

---

<div class="post-metadata">

**Author:** ![svsmailus](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/svsmailus/32/4839_2.png) [@svsmailus](https://discourse.devontechnologies.com/u/svsmailus)\
**Post date:** [March 11, 2021, 3:42pm UTC](https://discourse.devontechnologies.com/t/challenges-with-the-automatic-rtf-to-markdown-converter-solved-in-devonthink-3-8/62896/5 "2021-03-11T15:42:29Z")

</div>

The URLS were links from apples messages app.

---

<div class="post-metadata">

**Author:** ![cgrunenberg](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/cgrunenberg/32/7172_2.png) [@cgrunenberg](https://discourse.devontechnologies.com/u/cgrunenberg)\
**Post date:** [March 12, 2021, 9:24am UTC](https://discourse.devontechnologies.com/t/challenges-with-the-automatic-rtf-to-markdown-converter-solved-in-devonthink-3-8/62896/6 "2021-03-12T09:24:15Z")

</div>

The next release will improve this.

---

<div class="post-metadata">

**Author:** ![pete31](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/p/d26b3c/32.png) [@pete31](https://discourse.devontechnologies.com/u/pete31)\
**Post date:** [April 6, 2021, 2:52pm UTC](https://discourse.devontechnologies.com/t/challenges-with-the-automatic-rtf-to-markdown-converter-solved-in-devonthink-3-8/62896/7 "2021-04-06T14:52:25Z")

</div>

@cgrunenberg Why is it necessary to use menu `Edit > Paste and Match Style` when pasting into a Markdown record?

It shouldn’t be this way, I want to paste with ⌘+V **without any modification**

 ![Why?](https://devontech-discourse.s3.dualstack.us-east-1.amazonaws.com/uploads/original/3X/b/c/bc90c78ea7d721caa2a4a9f191d1aae5e7abe9d8.png)

---

<div class="post-metadata">

**Author:** ![cgrunenberg](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/cgrunenberg/32/7172_2.png) [@cgrunenberg](https://discourse.devontechnologies.com/u/cgrunenberg)\
**Post date:** [April 6, 2021, 2:55pm UTC](https://discourse.devontechnologies.com/t/challenges-with-the-automatic-rtf-to-markdown-converter-solved-in-devonthink-3-8/62896/8 "2021-04-06T14:55:16Z")

</div>

Does the clipboard contain rich text? Then it’s converted to Markdown (e.g. certain styles are retained and characters escaped)

---

<div class="post-metadata">

**Author:** ![pete31](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/p/d26b3c/32.png) [@pete31](https://discourse.devontechnologies.com/u/pete31)\
**Post date:** [April 6, 2021, 3:00pm UTC](https://discourse.devontechnologies.com/t/challenges-with-the-automatic-rtf-to-markdown-converter-solved-in-devonthink-3-8/62896/9 "2021-04-06T15:00:10Z")

</div>

Nope. Clipboard is set via [script](https://discourse.devontechnologies.com/t/copy-text-from-one-document-and-pasting-it-with-reference/63504/5).

---

<div class="post-metadata">

**Author:** ![cgrunenberg](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/cgrunenberg/32/7172_2.png) [@cgrunenberg](https://discourse.devontechnologies.com/u/cgrunenberg)\
**Post date:** [April 6, 2021, 3:03pm UTC](https://discourse.devontechnologies.com/t/challenges-with-the-automatic-rtf-to-markdown-converter-solved-in-devonthink-3-8/62896/10 "2021-04-06T15:03:09Z")

</div>

At least internally the clipboard seems to contain rich text (or AppleScript automatically copied it too?), pasting definitely converts only rich text but not plain text.

---

<div class="post-metadata">

**Author:** ![pete31](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/p/d26b3c/32.png) [@pete31](https://discourse.devontechnologies.com/u/pete31)\
**Post date:** [April 6, 2021, 3:23pm UTC](https://discourse.devontechnologies.com/t/challenges-with-the-automatic-rtf-to-markdown-converter-solved-in-devonthink-3-8/62896/11 "2021-04-06T15:23:23Z")

</div>

> [@cgrunenberg](#):
>
> At least internally the clipboard seems to contain rich text (or AppleScript automatically copied it too?)

Indeed. Using this script after using the linked one …

```auto
-- Get RTF Clipboard as string

use AppleScript version "2.7"
use framework "AppKit"
use scripting additions

set theNSClipboard_RTF to current application's NSPasteboard's generalPasteboard's stringForType:("public.rtf")
set theNSClipboard_RTF_string to theNSClipboard_RTF as string

```

  
… results in 

```auto
{\rtf1\ansi\ansicpg1252\cocoartf1671\cocoasubrtf600
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
{\*\expandedcolortbl;;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\partightenfactor0

\f0\fs24 \cf0 Why is it necessary to use menu Edit > Paste and Match Style? ([Test PDF.pdf](x-devonthink-item://7D58680E-726C-4107-8DE0-CDE0295AF06C?page=0))}

```

  

So the clipboard seems to be automatically set to RTF with some default style.

Would it be possible to only use the RTF clipboard (and conversion) if the clipboard contains any style attributes that differ from this default style? This way we could use ⌘ V the normal way. It really shouldn’t be necessary to use an extra menu just to paste.

---

<div class="post-metadata">

**Author:** ![BLUEFROG](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/bluefrog/32/135_2.png) [@BLUEFROG](https://discourse.devontechnologies.com/u/BLUEFROG)\
**Post date:** [April 6, 2021, 3:41pm UTC](https://discourse.devontechnologies.com/t/challenges-with-the-automatic-rtf-to-markdown-converter-solved-in-devonthink-3-8/62896/12 "2021-04-06T15:41:40Z")

</div>

> [@pete31](#):
>
> This way we could use ⌘ V the normal way. It really shouldn’t be necessary to use an extra menu just to paste.

Paste and Match Style is not an uncommon paste method, frequently used in rich text, Word, Pages, etc.  
People also wanted the ability to convert between rich text content and Markdown. The current mechanism does just that and rather conveniently.

---

<div class="post-metadata">

**Author:** ![pete31](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/p/d26b3c/32.png) [@pete31](https://discourse.devontechnologies.com/u/pete31)\
**Post date:** [April 6, 2021, 4:39pm UTC](https://discourse.devontechnologies.com/t/challenges-with-the-automatic-rtf-to-markdown-converter-solved-in-devonthink-3-8/62896/13 "2021-04-06T16:39:17Z")

</div>

> [@BLUEFROG](#):
>
> Paste and Match Style is not an uncommon paste method, frequently used in rich text, Word, Pages, etc.

Paste and Match Style is an uncommon paste method in **Markdown**.

What a user puts on the clipboad **shouldn’t be changed unless the user explicitly tells an app to change it**. Period.

> [@BLUEFROG](#):
>
> People also wanted the ability to convert between rich text content and Markdown.

Understood. But

- if users want RTF to Markdown conversion then **they should have to use an extra shortcut for that**.

- if users don’t want to change anything while pasting then **they shouldn’t be forced to remember a new shortcut, i.e. they should be able use the same shortcut as they did for years.**

I know no other app that replaced the behavior of a shortcut for a new feature.

This reminds me of removing the ability to search the whole Markdown source as discussed in this very interesting thread [DT3 searching markdown footnotes fails](https://discourse.devontechnologies.com/t/dt3-searching-markdown-footnotes-fails/63059). In this thread we were told:

> [@DT3 searching markdown footnotes fails](https://discourse.devontechnologies.com/t/dt3-searching-markdown-footnotes-fails/63059/4):
>
> there’s no indication we have many people searching the source of Markdown files for things like MMD metadata or item links. We do have data people were having problems searching Markdown since it was searching the source and also bloating the concordance.

It seems that again some users requested a new behavior and again DEVONthink **replaced** the old behavior instead of **adding** the new one.

And again this seems to have happened without knowing how users use DEVONthink or without thinking through the new behavior.

No problem if new features are **added** , but simply **replacing** old behavior without an option to get the old behavior back is a no go.

@cgrunenberg please add an extra shortcut for RTF to Markdown conversion or make the automatic conversion **optional**. I really don’t understand why DEVONthink started to **replace** well established behavior with some fancy things.

---

<div class="post-metadata">

**Author:** ![chrillek](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/chrillek/32/29340_2.png) [@chrillek](https://discourse.devontechnologies.com/u/chrillek)\
**Post date:** [April 6, 2021, 5:09pm UTC](https://discourse.devontechnologies.com/t/challenges-with-the-automatic-rtf-to-markdown-converter-solved-in-devonthink-3-8/62896/14 "2021-04-06T17:09:04Z")

</div>

I’m not sure that I understand the argument. It _seems_ to me that someone (a script?) copied RTF content to the Pasteboard (which is an OS feature, not a DT one, I think?). Under this assumption: In the Pasteboard, the data is RTF. On pasted into a MD file, you want the RTF stuff removed and only the bare text pasted?  
I don’t know enough about NextStep and all these APIs, but on other systems, one could possibly provide a target “format” (like a MIME-type) on pasting. Then the OS would do The Right Thing™ (or nothing at all, e.g. if you try to paste a JPEG with a target format of text ;-).  
However, on MacOS it seems to be very common that attributes of data (e.g. the font/style from an HTML, spread sheet or word document) are _preserved_ in pasting (if that’s at all possible in the target).

---

<div class="post-metadata">

**Author:** ![pete31](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/p/d26b3c/32.png) [@pete31](https://discourse.devontechnologies.com/u/pete31)\
**Post date:** [April 6, 2021, 5:16pm UTC](https://discourse.devontechnologies.com/t/challenges-with-the-automatic-rtf-to-markdown-converter-solved-in-devonthink-3-8/62896/15 "2021-04-06T17:16:08Z")

</div>

The problem is that DEVONthink changed behavior, nothing else.

I want to be able to use CMD + V to paste a clipboard that was set via script **without changing the pasted content**. This worked for years. Now with this fancy new automatic „RTF to Markdown“ conversion it doesn’t work anymore.

Please try the script I linked above to see what I mean.

* * *

Edit:

> [@chrillek](#):
>
> one could possibly provide a target “format” (like a MIME-type) on pasting. Then the OS would do The Right Thing™

That’s how it works on macOS too.

Setting the clipboard via plain AppleScript also includes a RTF version (that’s something I wasn’t aware of before and it seems @cgrunenberg also wasn’t aware).

Pasting into a Markdown record used to paste without any modification.

But now, with the automatic “RTF to Markdown” conversion, the pasted content is escaped for Markdown. That’s obviously not what a user wants if the clipboard contains a Markdown link because escaped links won’t work.

---

<div class="post-metadata">

**Author:** ![cgrunenberg](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/cgrunenberg/32/7172_2.png) [@cgrunenberg](https://discourse.devontechnologies.com/u/cgrunenberg)\
**Post date:** [April 7, 2021, 7:32am UTC](https://discourse.devontechnologies.com/t/challenges-with-the-automatic-rtf-to-markdown-converter-solved-in-devonthink-3-8/62896/16 "2021-04-07T07:32:55Z")

</div>

> [@pete31](#):
>
> That’s obviously not what a user wants if the clipboard contains a Markdown link because escaped links won’t work.

That’s true. But usually rich text (copied from websites, emails or documents) doesn’t contain raw Markdown code and therefore it’s nice to have some basic styling converted and that you don’t have to worry about special characters. In this case the clipboard seems to work as expected:

```auto
tell application id "DNtp"
	set theStr to "[Markdown Test](x-devonthink-item://3C86525C-B290-48CD-ACD6-9BF5918C8EAE)"
	set the clipboard to theStr as string
end tell

```

---

<div class="post-metadata">

**Author:** ![pete31](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/p/d26b3c/32.png) [@pete31](https://discourse.devontechnologies.com/u/pete31)\
**Post date:** [April 7, 2021, 1:09pm UTC](https://discourse.devontechnologies.com/t/challenges-with-the-automatic-rtf-to-markdown-converter-solved-in-devonthink-3-8/62896/17 "2021-04-07T13:09:34Z")

</div>

> [@cgrunenberg](#):
>
> In this case the clipboard seems to work as expected:
> 
> ```auto
> tell application id "DNtp"
> set theStr to "[Markdown Test](x-devonthink-item://3C86525C-B290-48CD-ACD6-9BF5918C8EAE)"
> set the clipboard to theStr as string
> end tell
> 
> ```

Pasting this script’s result into a Markdown record yields an invalide Markdown link, so it just shows the problem again 🙂

> [@cgrunenberg](#):
>
> But usually rich text (copied from websites, emails or documents) doesn’t contain raw Markdown code and therefore it’s nice to have some basic styling converted and that you don’t have to worry about special characters.

I understand the idea and in fact like it.

However, the problem remains that the normal pasting behavior was **replaced** and there’s **no option** to get it back.

I know this wasn’t intended but it’s the result of the decision to automatically escape the RTF clipboard when pasting into a Markdown record.

Again, I like the idea of making it easier for some users, however this results in making it unnecessary complicated for other users. That’s why it should be **optional**. Especially such a basic thing like pasting shouldn’t force users to think about it.

Please add an option that stops the automatic conversion.

---

<div class="post-metadata">

**Author:** ![cgrunenberg](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/cgrunenberg/32/7172_2.png) [@cgrunenberg](https://discourse.devontechnologies.com/u/cgrunenberg)\
**Post date:** [April 7, 2021, 1:16pm UTC](https://discourse.devontechnologies.com/t/challenges-with-the-automatic-rtf-to-markdown-converter-solved-in-devonthink-3-8/62896/18 "2021-04-07T13:16:56Z")

</div>

> [@pete31](#):
>
> Pasting this script’s result into a Markdown record yields an invalide Markdown link, so it just shows the problem again 🙂

Which version of macOS do you use?

---

<div class="post-metadata">

**Author:** ![pete31](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/p/d26b3c/32.png) [@pete31](https://discourse.devontechnologies.com/u/pete31)\
**Post date:** [April 7, 2021, 1:17pm UTC](https://discourse.devontechnologies.com/t/challenges-with-the-automatic-rtf-to-markdown-converter-solved-in-devonthink-3-8/62896/19 "2021-04-07T13:17:32Z")

</div>

10.14.6 Mojave

---

<div class="post-metadata">

**Author:** ![chrillek](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/chrillek/32/29340_2.png) [@chrillek](https://discourse.devontechnologies.com/u/chrillek)\
**Post date:** [April 7, 2021, 1:24pm UTC](https://discourse.devontechnologies.com/t/challenges-with-the-automatic-rtf-to-markdown-converter-solved-in-devonthink-3-8/62896/20 "2021-04-07T13:24:36Z")

</div>

The code posted by @cgrunenberg works ok on my Big Sur: It writes something to the clipboard that gets pasted exactly as an MD link in DT and another app. Maybe Apple _did_ fix something after all in Big Sur 😉

[Next page](https://discourse.devontechnologies.com/t/challenges-with-the-automatic-rtf-to-markdown-converter-solved-in-devonthink-3-8/62896.md?page=2)
