PopClip extension snippet for DeepL Write

This is a rather simple PopClip extension for DeepL Write, a service to correct and improve your writing. Currently (November 2023) there is no API access available. This extension opens selected text on the DeepL Write website, where you can set options like intended audience (style) or how proposed changes are displayed.

#popclip
name: DeepL-Write
icon: iconify:game-icons:quill-ink
url: https://www.deepl.com/write#en/***
description: DeepL Write (English)

(The above block is an extension snippet ā€” select it then click ā€œInstall Extensionā€ in PopClip.)

While the website mostly recognizes the language of the text input, you can also specify which language to use with the following snippet. It adds an alternative URL to open German input. You can trigger this behaviour by holding the option key while clicking the PopClip action.

#popclip
name: DeepL-Write
icon: iconify:game-icons:quill-ink
url: https://www.deepl.com/write#en/***
alternate url: https://www.deepl.com/write#de/***
description: DeepL Write (English or German)

(The above block is an extension snippet ā€” select it then click ā€œInstall Extensionā€ in PopClip.)

1 Like

Great use of the alternate url! Itā€™s the first one Iā€™ve seen in the wild. Sometimes Iā€™m not sure if people have read the docs so here is proof. :slight_smile:

1 Like

Thanks for the idea (and the great icon) but unfortunately the new DeepL tool is only in EN or DE but still not in French :-(. But i hope soon.
Note : I already asked DeepL To add translation from EN > EN (or any language) to permit to correct our textā€¦ without answer until this new function ;:wink:

When more languages become available, only the language code needs to be adjusted in the above snippet.

yes, of course. Iā€™ve already tested with fr in the snippetā€¦ and i saw the answer of DeepL : ā€œwriteā€ function only available for EN & DEā€¦ (but itā€™s ok for my job ! iā€™m writing in EN or DE, newer in FR ! but on winOS :frowning:

I am a big fan of the Deepl Write extension. Unfortunately, the transfer of text with Markdown links often fails. Is there a way to encode the text better so that the complete text arrives on the website?

Example:

Please correct my text with an MD link: [SONAX PROFILINE Microfibre Wash 1 Liter spezielles FlĆ¼ssigwaschmittel fĆ¼r MicrofasertĆ¼cher und Polierscheiben | Art-Nr. 04523000 : Amazon.de: Auto & Motorrad](https://www.amazon.de/SONAX-Fl%C3%BCssigwaschmittel-Microfasert%C3%BCcher-Polierscheiben-04523000/dp/B0BLZ5VG8Y) lorem ipsum.

In this case, only the following text is received in Deepl Write:

/www.amazon.de

Okay. After analyzing the URL at Deepl I found the problem. With the version of @kolkrabe the characters | and / are not encoded. At least thatā€™s what the Deepl website requires.

My version (I use only the DE-Version):

#popclip
name: DeepL-Write (DE)
icon: iconify:game-icons:quill-ink
identifier: com.konfluenzpunkt.popclip.extensions.deeplDE
version: 240104
description: DeepL Write (DE)
note: based on the fantastic snippet by ā˜…kolkrabeā˜…
after: copy-selection
javascript: |
  let dtext = popclip.input.text
  dtext = dtext.replaceAll('|', '\\|');
  dtext = dtext.replaceAll("/", "\\/");
  const url = `https://www.deepl.com/write#de/${dtext}`;
  popclip.openUrl(url, { app: "company.thebrowser.Browser" });

Version without calling the Arc browser and the original string is not copied to the clipboard.

#popclip
name: DeepL-Write (DE)
icon: iconify:game-icons:quill-ink
identifier: com.konfluenzpunkt.popclip.extensions.deeplDE
version: 240104
description: DeepL Write (DE)
note: based on the fantastic snippet by ā˜…kolkrabeā˜…
javascript: |
  let dtext = popclip.input.text
  dtext = dtext.replaceAll('|', '\\|');
  dtext = dtext.replaceAll("/", "\\/");
  const url = `https://www.deepl.com/write#de/${dtext}`;
  popclip.openUrl(url);

Maybe @nick can take another look at the code?

Edit: 24/01/04 - fixed the serach & replace string

1 Like