Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Triggering User Customizable Actions #1586

Open
pinntokuru opened this issue Nov 11, 2024 · 3 comments
Open

Triggering User Customizable Actions #1586

pinntokuru opened this issue Nov 11, 2024 · 3 comments
Labels
kind/enhancement The issue or PR is a new feature or request

Comments

@pinntokuru
Copy link

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.

@pinntokuru pinntokuru added the kind/enhancement The issue or PR is a new feature or request label Nov 11, 2024
@Kuuuube
Copy link
Member

Kuuuube commented Nov 11, 2024

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.

@pinntokuru
Copy link
Author

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.

@Kuuuube
Copy link
Member

Kuuuube commented Nov 11, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement The issue or PR is a new feature or request
Projects
None yet
Development

No branches or pull requests

2 participants