AutoHotKey not working

Hi, I use Studio 2019 and have just installed the AutoHotKey Manager plugin (and also the Microsoft program mentioned here: community.sdl.com/.../3171.ahk-plugin), but I cannot get it to work. I have added 2 scripts which I found on other Studio support pages:

#IfWinActive ahk_exe SDLTradosStudio.exe
;------------------------------------------------------------------------------
;Go to next segment
;------------------------------------------------------------------------------
^{Down}::
Send ^{PgDn}
Send {Down}
Send ^{PgUp}
return

and

#IfWinActive ahk_exe SDLTradosStudio.exe
;------------------------------------------------------------------------------
;Go to previous segment
;------------------------------------------------------------------------------
^{Up}::
Send ^{PgUp}
Send {Up}
Send ^{PgDn}
return

Their effect should be to enable Ctrl+Up/Down to move one segment up or down in a text (regardless of whether or not the segment is confirmed or not - for some reason, the default Ctrl+Up/Down keyboard shortcuts in Studio jumps to next/previous unconfirmed segment even though this does not seem to be the intended behaviour), but they do not work. I even disabled the default Ctrl+Up/Down shortcuts in Studio's settings in order to avoid conflicts, but this did not change anything. Can anyone help with this, please? Of course, if anyone can tell me how to get the "normal" Studio shortcuts for "Move to Next/Previous Segment" to do exactly this rather than moving to next/previous unconfirmed segment, that would be great, although I would also like to get AutoHotKey Manager to work!

Thanks a lot in advance.

Best regards,
Dennis

Parents
  • Hello  

    Try these which I use all the time:

    ;------------------------------------------------------------------------------
    ; Move to next segment
    ;------------------------------------------------------------------------------
    #IfWinActive SDL Trados Studio
    !right::
    Send, {ctrl down}{pgdn}{ctrl up}
    Send, {down}
    Send, {ctrl down}{pgup}{ctrl up}
    Return
    #IfWinActive

    ;------------------------------------------------------------------------------
    ; Move to previous segment
    ;------------------------------------------------------------------------------
    #IfWinActive SDL Trados Studio
    !left::
    Send, {ctrl down}{pgup}{ctrl up}
    Send, {up}
    Send, {ctrl down}{pgup}{ctrl up}
    Return
    #IfWinActive

    Seems odd... but never fails for me.

  • To write code is not so easy work.
    You have to try to cover all possible cases.

    In this code, you missed two of them.
    Both of them are related with silly bug of SDL Trados Studio

    1/2 You are at segment number "1" and AHK code goUp executed.
    2/2 You are at the last segment number and AHK code goDown executed.

    Fortunately, AHK is just outsider of SDL Trados Studio so it doe not make any kind of fatal error.
    If you executed same action from inside of SDL Trados Studio (PlugIn) you will regret.
    SDL should fix this part. Block the Orange numberless segments (Top and Bottom segments).

    regards

     

    [EDIT]

    There is No way to achieve this goal perfectly through AHK.
    Because AHk is blind to SDL's segment (I told you, AHK is just outsider...)

    But, If you use PlugIn, it is so easy and PERFECT. right ?


    It is very strange to me, why any customer never complained about this? This so simple and basic function to be offered by SDL. Not through this kind of amateur codes but by professional engineers touch.

    Screenshot of Trados Studio interface showing 'Up' and 'Down' navigation buttons highlighted with a red box, indicating the area of the bug mentioned.

    emoji


    Generated Image Alt-Text
    [edited by: Trados AI at 4:07 AM (GMT 0) on 5 Mar 2024]
  • and

    It is some rare cases though, You have to consider.

    I have checked with simple AHK codes.

    It jumps "numberless segs" sometimes and the others visited.

    I can not figured out reasonable logic from there.

    Screenshot of Trados Studio showing a document with numbered segments, some segments are highlighted indicating a selection or focus.

    But, If you use PlugIn, it works perfectly. I mean, just visits numbered segments.

    Do you want to visit numberless segs too ? I do not know. Looks like PlugIn is Not ready to do it properly too.

    I guess, SDL should try to remove this numberless segments.

    emoji


    Generated Image Alt-Text
    [edited by: Trados AI at 4:08 AM (GMT 0) on 5 Mar 2024]
Reply Children
No Data