Hotkeys used within AHK scripts (such as ^a, ^c, etc.) don't seem to work any more after I installed Trados Studio 2021 SR2 - 16.2.8.9097 yesterday. Most of my AHK scripts no longer work.
Hotkeys used within AHK scripts (such as ^a, ^c, etc.) don't seem to work any more after I installed Trados Studio 2021 SR2 - 16.2.8.9097 yesterday. Most of my AHK scripts no longer work.
I just tested it, and the clipboard functions (via an AU3 script) work as expected in SR2.
When you run your script, do you get the error message, or does nothing happen, or does it show the previously copied clipboard?
I get the error message, i.e., Error=1. This shows that the clipboard is empty, because ^c or ^a or both do not work.
I also modified the Send ^a^c command to Send ^c and issued the Ctrl-a command manually before starting the script. Same result. I also used ^a only. Same result. I also tried Send {right}. The cursor did not move. So it seems that no AHK keyboard command works.
Have you tried a different hotkey? Are you 100% sure Trados is the active window when you press the hotkey? Have you tried a script that doesn't have a hotkey but instead runs its functions after e.g. 2 seconds (enough time to switch to Trados and ensure your cursor is in the right place after you double-clicked the script)? Are you sure you have exited the previous instances of the test scripts before starting the new instances?
Yes, I tried Ctrl-X, Ctrl-Y. The actual script using this piece of code uses Ctrl-Shift-C. I've also reset the shortcuts to defaults. And I always recompiled when making any changes to the script during the tests. I'm 100% sure that Trados is the active window. All this works perfectly when using Trados Studio 2019, as I just found out. It's highly probable that it has something to do with the SR2 of Studio 2021 that is in conflict with something on my computer. Is there a way to undo the SR2?
Slightly off-topic: with the most usual installation of AHK, you don't need to compile most scripts to run them. You can just double-click the AHK file.
Ignore my question about exiting the script -- I see now that AHK warns one if you try to run same script twice simultaneously. AU3 doesn't warn the user of this.
Actually, when I said "compiled", I meant "double-clicking the AHK file".
The fault may also be mine: I use the term "compile" for turning the AHK file into an EXE file that can be run on a computer that doesn't have AHK installed. But I can't remember all the installation options of AHK -- perhaps one can install it in such a way that double-clicking it does, in fact, create an EXE file from it.
Actually, my understanding of "compile" is the same as yours. I was just imprecise in my wording. Double-clicking the AHK script file probably just activates the latest version of the file for being interpreted by the AHK client. The AHK package does include a compiler named ahk2exe.exe that seems to generate exe files, but I haven't tried that yet.
Actually, my understanding of "compile" is the same as yours. I was just imprecise in my wording. Double-clicking the AHK script file probably just activates the latest version of the file for being interpreted by the AHK client. The AHK package does include a compiler named ahk2exe.exe that seems to generate exe files, but I haven't tried that yet.