When using draft submit to send text from the Draft Window back to another application, sometimes several characters are lost from the start. This is very inconsistent, sometimes dropping 0 characters, and other times dropping 4-5. Occasionally, it will entirely fail to copy over anything.
I tested this by repeatedly doing draft edit all (which worked fine) and then draft submit, which should have simply placed the words back in the original spot, but fails in one of the ways I described about half the time.
Additionally, I tried removing the Draft Editor to ensure the overlapping draft submit commands could not interfere, but this made no difference.
This was brought up in #1695 previously. It is also mentioned in talonvoice/talon#254 (comment), but I'm unclear whether Talon or Draft Window is at fault. However, it seems there is a simple fix that Community can introduce.
I believe the issue is that the Draft Window command begins sending text prior to the other application regaining full focus. The switching time is dependent on computer performance and application responsiveness, and thus seemingly random. This is supported by an app.notify(content) line at the end of draft submit showing the full context, meaning that user.draft_get_text() is not failing. It is also supported by a simple sleep(50ms) just before insert(content) in draft submit being enough to make the program work consistently. I am unsure if this is an ideal solution, however, as the time is likely to be very machine-dependent.
When using
draft submitto send text from the Draft Window back to another application, sometimes several characters are lost from the start. This is very inconsistent, sometimes dropping 0 characters, and other times dropping 4-5. Occasionally, it will entirely fail to copy over anything.I tested this by repeatedly doing
draft edit all(which worked fine) and thendraft submit, which should have simply placed the words back in the original spot, but fails in one of the ways I described about half the time.Additionally, I tried removing the Draft Editor to ensure the overlapping
draft submitcommands could not interfere, but this made no difference.This was brought up in #1695 previously. It is also mentioned in talonvoice/talon#254 (comment), but I'm unclear whether Talon or Draft Window is at fault. However, it seems there is a simple fix that Community can introduce.
I believe the issue is that the Draft Window command begins sending text prior to the other application regaining full focus. The switching time is dependent on computer performance and application responsiveness, and thus seemingly random. This is supported by an
app.notify(content)line at the end ofdraft submitshowing the full context, meaning thatuser.draft_get_text()is not failing. It is also supported by a simplesleep(50ms)just beforeinsert(content)indraft submitbeing enough to make the program work consistently. I am unsure if this is an ideal solution, however, as the time is likely to be very machine-dependent.