Open pinntokuru opened 1 week ago
What is the goal of taking a screenshot here? Yomitan can already take a screenshot of your browser.
Also the only way yomitan can interact with desktop apps is with the native messaging api which i doubt sharex supports (and ofc almost nothing else does either).
Yomitan cannot send a hotkey or any other signal anywhere besides inside the browser's sandbox.
What is the goal of taking a screenshot here? Yomitan can already take a screenshot of your browser.
My own purpose would be screenshots for games or video players mainly. Since these windows are not part of the browser Yomitan cannot capture them. Also even for browsers ShareX is a dedicated image taking program that offers a ton of functionality that Yomitan does not.
Also the only way yomitan can interact with desktop apps is with the native messaging api which i doubt sharex supports (and ofc almost nothing else does either).
I think AutoHotkey supports native messaging (at least it used to when I used to tinker with it long ago). If Yomitan could communicate with AHK it can call ShareX or any other program the user wishes.
I'm not familiar with what restrictions Yomitan has wrt writing permissions, but if nothing else works if Yomitan can simply create and write to a temp text file somewhere then that can be enough for a AHK to use as a trigger.
This isnt unfeasible but honestly you'd probably be better off making an Anki addon that checks for a card being added. It's unlikely this will be added to Yomitan anytime soon with how many other things are going to be higher priority.
A very useful feature would be to add customizable "actions" to specific events like looking up words or adding a card to Anki. For example when the user adds a card to Anki it then somehow triggers a screenshot. Or when the user looks up a word it updates a file that keeps track of how many times you've looked that word up.
Using the screenshot example, this feature can be implemented in various ways depending on how complicated you want to get.
The simplest would be to simply send a customizable hotkey signal after an action. The user can then simply set up a program like ShareX to listen to the hotkey.
Technically this should be enough as one can set up an AutoHotkey script to listen to that hotkey to do whatever they want afterwards.
A slightly more complicated but more flexible solution would be to have the user run a customizable command. This is actually what ShareX does with its "Perform Action" option, and how it makes it possible to send screenshots to Anki cards. This might be the way to go if one is concerned about this functionality being compatible with as many applications as possible. It would also enable more complicated actions for the user.
I've tried several ways to make this happen for my own immersion workflow, but the limiting factor is the unpredictability of how long it takes for Yomitan to add a card. Sometimes it's near-instant, and sometimes it gets "stuck" and takes several seconds. Setting up a macro that first adds a card then waits a bit to take a screenshot does not always work.