[Bug 2.1.64] The updated version of Anki is causing functionality problems with AutoHotkey and GoldenDict

[Bug 2.1.64] The updated version of Anki is causing functionality problems with AutoHotkey and GoldenDict.

In particular, I use an AutoHotkey code which allows me to copy a word located at the mouse cursor and look it up in GoldenDict by simply pressing F3.

However, following the update to version 2.1.64, the stability of performing swift word searches in Anki using GoldenDict, when utilizing AutoHotkey scripts, has been compromised.

Despite attempting to rectify the issue by updating AutoHotkey to the newest version, the problem with Anki continues.

I am truly grateful for any assistance!

#IfWinActive, ahk_exe anki.exe
; (1)
F3::
	Click, 2 ;
		clipboard = 
	send ,^c
	ClipWait,0.01 ; 
		Send {Ctrl down}cc{Ctrl up} ; 
	;~ run C:\Users\GoldenDict.exe  %clipboard%
Return

Hi! Just solved a problem regarding 2.1.64 and thought maybe my solution could be applicable to your problem as well.

  • My problem: Anki would not show check marks within checkboxes no matter how hard I tried.
  • Cause: Anki wasn’t installed at its regular place, over at “C:\Program Files\Anki”. Rather, it was installed at %APPDATA%, something like “C:\Users<yourUserName>\AppData\Roaming”. Because of this, some of the files did not install properly, and the check marks did not show up. It probably caused some more errors that I didn’t notice.
  • Solution: Run the installer again, this time by right-clicking and select “Run as Administrator…”. Also, make sure the install path is back at its original value, “C:\Program Files\Anki”.

So, please make sure Anki.exe is located wherever it was back in 2.1.63. Maybe that way GoldenDict will react as expected.

Kind regards,
Iván

1 Like

Thank you for providing suggestions for me to attempt resolving the issue. I have performed actions as you advised, and regrettably, the result is not yet successful! Nevertheless, I am truly appreciative of your enthusiasm!

@Ivan_20 you shouldn’t need to do that. Did you try reinstalling in the same user folder? The only explanation I can think of is your antivirus removing a file.

@loveankiloveanki presumably you have jumped multiple Anki versions at once, and the issue is with Qt 6.5. You may have more luck with the Qt5 version of Anki.

1 Like

Hi @dae! Really honored to be able to talk with the man himself :slight_smile:

I’ve been thinking about how to approach this subject since you last posted. As a result, I’ve performed a number of controlled reinstallations of Anki, the details of which I reproduce in this message.

In my humble opinion, I think the problem lies within the path I am using, particularly with the “Iván” part. Notice the “á” symbol? That symbol has been problematic for me in the past. The thing is, CMD’s charset handling is not always predictable, and the “á” symbol tends to be substituted for something else, say “¬”. When that happens, some files can’t be found/read/written, maybe resulting in the “weird look” problem. Perhaps the line “%~dp0” in anki-console.bat? (NOTE: I’ve tried to execute that particular line and it returns the path correctly, “C:\Users\Iván\AppData\Local\Programs\Anki”, but maybe, just maybe…)

That said, I hope you can track down whatever issue this is, you know Anki better than anyone. I am entirely happy to install Anki elsewhere and continue studying, so no hurries from this side. Also, should it be of any help, I am down for additional testing. Maybe a Windows Registry export? A CRC listing of the installed files?

EDIT: just performed 2 additional tests…

  • Install @ C:\Users\Iván\AppData\Local\Programs\Anki. Create another desktop icon. Same problem, looks weird.
  • Install @ C:\Users\Iván\AppData\Local\Programs\Anki. Copy contents to C:\Temp. Execute via dbl-click anki.exe. Works flawlessly. So, probably not related to the files themselves, but rather to the chosen path? Maybe it’s the “á” symbol?

AV: off (Avast, everything offline).
Installation: dbl-click on anki-2.1.64-windows-qt6.exe file (did not explicitly invoke local admin privileges, but the account is part of the local admin group).
Path: C:\Users\Iván\AppData\Local\Programs\Anki
Content: 1.079 files, 125 folders.
Size: 490 MB (513.851.873 bytes).
Size on disk: 491 MB (515.764.224 bytes).
Execution: dbl-click on Anki desktop icon.
Result: looks weird (e.g. check marks not showing, menus have a different style…).

Next try:
AV: off (Avast, everything offline).
Installation: dbl-click on anki-2.1.64-windows-qt6.exe file (did not explicitly invoke local admin privileges, but the account is part of the local admin group).
Path: C:\Users\Ivan\AppData\Local\Programs\Anki
Result: error dialog box (error opening file for writing: C:\Users\Ivan\AppData\Local\Programs\Anki\anki.console.bat. Click Retry to try again, or Cancel to stop the installation).
Result: could not install.

Next try:
AV: off (Avast, everything offline).
Installation: right click on anki-2.1.64-windows-qt6.exe, execute as admin (local admin).
Path: C:\Users\Ivan\AppData\Local\Programs\Anki
Content: 1.070 files, 121 folders.
Size: 489 MB (513.681.932 bytes).
Size on disk: 491 MB (515.579.904 bytes).
Execution: dbl-click on Anki desktop icon.
Result: everything works flawlessly, app is ready to go and looks beautiful.

Kindly,
Iván

1 Like

I’ve tried many different solutions but still don’t understand why it is like this. It’s sad, even though I don’t want to, I still have to go back to the version I’m used to (2.1.54), hoping in future versions I will be lucky. hihi.

I have tried with QT5, but Anki still encounters a non-responsive error when pressing the F3 key.

@Ivan_20 thanks for the detailed steps; I will investigate

@loveankiloveanki F3 is a shortcut in Anki to attach a media file, so you may have a conflict if you’re trying to use it with another app that captures shortcuts.

So it turned out to be a Qt issue with only specific characters - I’d tested with Japanese characters but it handled those fine. A fix will be in the next release.

1 Like

Thank you ver ymuch, @dae!! Just saw the commit for the fix. If only the dev teams at my job were this fast… (just joking, I love them, it’s just they have to be everywhere these days…) …/commit/16c8c9cadc09841f811286dfb179d2f0520bcc1a

(PS: could there be other places in the code where Latin1 symbols in the path are causing similar path-related behaviours? What’s your take on that? Like, for example, could it be possible to have problems detecting unused multimedia, or maybe deleting it? I kind of have a feeling that Qt might be doing something… Well, nevermind, I’ll try to get some test data, see if it happens, and get back to you. Or, conversely, I could avoid using Latin1 symbols altogether hehehe =)

1 Like

The media handling code is in Rust and should work correctly with arbitrary unicode characters, which are fairly common in media folders. If you do run into an issue, please let us know the steps required to reproduce it.

1 Like

Hello! In 2.1.54 (b6a7760c) mouseover translation in QTranslate still works fine. And in versions 2.1.57-2.1.64 (Qt5/6) does not work anymore. Mahou (魔法) - The magic Layout Switcher (Anki hangs when switching layouts) does not work either. Something about global keyboard shortcuts interlocking, maybe.

1 Like

Sorry, I don’t understand what you mean. Could you elaborate?

The layout switching issue sounds like Anki hangs on switching language with hot keys for input languages on Windows 10 · Issue #1105 · ankitects/anki · GitHub

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.