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.
Sounds very odd. Can you share one small example that doesn't work, so we can at least see if there is anything in the script that might be affected by this?
Paul Filkin | RWS Group
________________________
Design your own training!
You've done the courses and still need to go a little further, or still not clear?
Tell us what you need in our Community Solutions Hub
Hi Paul:
See this test script as an example, which is an excerpt from a longer script:
;-----------------------------
;Ctrl+Shift X
;Testing Ctrl-a, Ctrl-C
;-----------------------------
^+x::
clipboard :=
Send ^a^c
ClipWait, 2
if (ErrorLevel > 0) {
Msgbox Error=%errorlevel%
Exit
}
Msgbox %clipboard%
Return
This works correctly in MS Word but not in Trados Studio 2021 SR2 - 16.2.8.9097. But it has worked correctly in Studio as well before.
I'm really at a loss what might be wrong here.
Kind regards,
-Friedrich
I'm not sure either. I tested it in Studio and presume this is what you expect?
I guess you don't have any Studio keyboard shortcuts that get in the way?
Paul Filkin | RWS Group
________________________
Design your own training!
You've done the courses and still need to go a little further, or still not clear?
Tell us what you need in our Community Solutions Hub
Exactly, that's the result I expect. I suspected that the problem is local to my PC because nobody has reported the same problem so far. But what may it be? I did not change the default hotkeys Ctrl-a and Ctrl-c in Studio, and they work as expected when I use them manually.
As this works properly in MS Word, for example, the problem must be associated with some setting in Studio. But what can it be?
Just noticed something Samuel Murray mentioned on ProZ because his scripts stopped working.
the taskbar title changed. It's no longer "SDL Trados Studio", but just "Trados Studio".
You didn't have anything in your script that used this but I wonder if you have set anything to identify the environment in your overall scripts that could be looking for the old name?
I use this in many of my scripts as they are specific to Trados Studio:
#IfWinActive SDL Trados Studio
And that actually still works... but perhaps there is something else in the way you use AHK?
Paul Filkin | RWS Group
________________________
Design your own training!
You've done the courses and still need to go a little further, or still not clear?
Tell us what you need in our Community Solutions Hub
Whether it would still work depends on whether AHK requires the taskbar title to be exact or just contain any of the words. In my earlier AU3 scripts, I used exact matching, but in my later scripts, I learnt to use inexact matching, so that just "Trados" would match a title of e.g. "SDL Trados Studio".
No, I don't have such conditional instructions in my script.
But changing the taskbar title created a problem in the Xbench agent. Xbench now always creates a new instance of Studio whenever I click on Edit Segment" instead of using the current instance. ApSIC support just confirmed this problem after I spent hours trying to drill down on this issue. They promised to send an update next week.
But this doesn't solve my AHK problem. As everything worked fine before, I suspect this problem is also due to some issue in SR2.
As everything worked fine before, I suspect this problem is also due to some issue in SR2.
It's quite hard to imagine what this might be. I don't have a problem with your script in SR2. But I suppose it's always possible that some change in the code, that isn't an issue in Trados Studio, has caused some sort of conflict on your computer.
I'm hopeful someone like Jesús Prieto or Nora Díaz who use AHK a lot will have some ideas, because have no other ideas.
Paul Filkin | RWS Group
________________________
Design your own training!
You've done the courses and still need to go a little further, or still not clear?
Tell us what you need in our Community Solutions Hub
I've just tested the sample script and it works as expected, as do my other AHK scripts, so it must definitely be something specific to Friedrich's computer.
Hi Nora,
I attended your ATA AHK course recently and learned about AHK for the first time. Thanks a lot. It initially worked like a charm.
But suddenly this problem started. I know by now that it must be local to my computer. But what might it be? It still works perfectly in all other applications. It's only Trados Studio Pro that's affected, i.e., none of the keyboard commands works.
I just tried Trados Studio 2019, which is still installed on the same computer. The script works there as expected. Also MultiTerm 2019 and 2021 are not affected. It's definitely only Studio 2021 SR2 that's giving me this problem - even after resetting all keyboard shortcuts to the defaults. Is there a way to undo the SR2?
I just tried Trados Studio 2019, which is still installed on the same computer. The script works there as expected. Also MultiTerm 2019 and 2021 are not affected. It's definitely only Studio 2021 SR2 that's giving me this problem - even after resetting all keyboard shortcuts to the defaults. Is there a way to undo the SR2?
That's very interesting. While I don't have any advice on rolling back SR2, I'm thinking of one thing you may want to try: running the script as administrator. What happens if you do that?
What do you mean? I usually double-click the AHK file, and within the Studio editor I use the key combination to run the script. I don't see an option to run this as administrator.
To run an AHK script as administrator, right-click the AHK file, and select "Run as administrator".
YES! That did it! That solved the problem, and my scripts work again!
Thank you so much, Nora and Samuel!
I still wonder, though, why I seem to be the only one who has this problem, and why this is unique to Studio 2021 on my PC.
See also this thread about how to run scripts as administrator. I believe it's possible to specify it in the script itself, so you don't have to right-click the script manually.
Yay! I'm not entirely sure why this happened only to you, but it may just be that others (like myself) are already running AutoHotkey with administrator privileges. You can do that by locating Autohotkey.exe and running it as administrator by right-clicking on it and selecting Run as administrator.
I suspect I somehow set Trados Studio 2021 to run as administrator by default, which means it runs as an "elevated" program, which does not allow input by a "non-elevated" program. I just learned that from the link that Samuel sent.