Start a new topic

No keyboard shortcut for Deepl MT translations (paid) - solution

There is no keyboard shortcut to retrieve the Deepl MT (paid) output from its tab.


I thought about using AHK, but it returns the wrong mouse position when I test where the translation is so I can't click it with AHK. Probably because I work with two monitors, AHK gets confused.


But, there is a solution: pyautogui in python. 


I knock together this simple script in python:

import pyautogui

pyautogui.click(489, 759)


The coordinates are good for my screen only, unless you have the same resolution. :-)


Ahk still plays a role, because I need a keyboard shortcut, so AHK launches the python script which clicks the translation and then returns me to the target box.


Don't know what I am talking about? Get your hands on the "Automate the boring stuff with Python". Go to the pyautogui chapter, and it will all become clear.


>There is no keyboard shortcut to retrieve the Deepl MT (paid) output from its tab.


Not sure what you mean.


image



1 person likes this

OK, I stand corrected. But at least I got my first encounter with pyautogui. To be continued... :-)

Buuuut... the funny thing is that in my instance of Cafetran (latest build for windows) this shortcut DOES NOT WORK, though it is listed. So my pyautogui solution still stands.

>But at least I got my first encounter with pyautogui.


Yep automating can be fun, and very time-consuming :). I'm not familiair with pyautogui yet. Not sure if it's available for macOS too. It seems to be ... https://github.com/asweigart/pyautogui/issues/247


However, I guess that many detect and position mouse cursor scenarios are already covered by Keyboard Maestro (which I use on Mac).

@Always... Admittedly we come from two different “ecosystems” but pyautogui will work on both. And I did not spend much time knocking together this shortcut.

>pyautogui will work on both, likely a Linux version is available too, so this can be a nice cross-platform enhancement for CafeTran Espresso 10 Croissant.

Here's the answer to why the Alt+E shortcut did not work. When you first activate the paid Deepl translator function, it does not work. You need to shut down CT and restart it. Then it starts working. 


Login to post a comment