Since you have linked to this thread on two other forums, I assume that my above instructions worked fine for you.
On the CafeTran forum you say that “you need the uber-useful Keyboard Maestro to execute the macros.” Just for clarification:
The Python script itself runs perfectly fine also without KM. You can run it with other launchers (Alfred, LaunchBar, etc.) or from within an AppleScript, etc., or of course simply from the Terminal.
In the Terminal, to get the result to the clipboard just pipe it to
pbcopy. If your system’s
LANG variable is correctly set to UTF-8 (the language doesn’t matter) then you don’t need the first line.
/usr/local/bin/python3 '<path/to/the/script>/translate.py' -l DE "$(pbpaste)" | pbcopy
would be a standalone command line for the Terminal that gets the input from the clipboard and pastes the output to the clipboard.
BTW, I’ve never heard of that CafeTran thingy before, but it looks very interesting. I’m also working as translator (not my main job though) and in the past I used OmegaT or, ahem, no CAT tool at all. I will definitely give CafeTran a serious try next time!
I’ve just seen that the forum links you’ve posted on Proz and Freshdesk go to post#2 in this thread. I’m not sure if this was your intention, since you also uploaded the ‘DeepL via Python’ macro file (which is from post #3).