New AutoHotkey forum

Hi,

I know many of you reading this won't have your notifications on for the new forum yet so this is just a short post directing your attention to here:

https://community.sdl.com/solutions/language/translationproductivity/f/400

This is a forum set up to provide a place where users can learn more about AutoHotkey which is a free, and excellent automation tool that you can use with any windows application.

Why is this useful?  Ever wanted to be able to remove the AT status from the segment you are working on, or merge segments with a single keyboard shortcut, or get a character count from some selected text?  If you did, and if you had other things that you'd like to be able to do then it's worth giving AutoHotkey a look and I hope that over time this new forum will become a place where you can find useful scripts to help you automate your work, and where you can share the amazing things you create!

Regards

Paul

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

  • Thank you Paul! Dumb question: what do I have to do to get notifications from the new forum? I looked but I couldn't find anything and I can't remember how it's done.
  • Hi Nora,

    Go here:

    https://community.sdl.com/solutions/language/translationproductivity/

    Change the "No" to "Yes" by clicking on it:

    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

  • Thank you Paul. I expected to see a notifications button within the forum itself, should have looked more carefully! : )
  • Hello forum

    Totally new to AutoHotKey.

    How do you
    1 map a script to a shortcut, and/or
    2 invoke a script from Trados ?

    (in this case, Nora's paste-from-word code).

    Thanks


  • Hi JF,

    See if this helps:

    First, download AutoHotkey (www.autohotkey.com) and install it. Once installed, you won't see anything open, that's normal. AutoHotkey runs in the background and allows you to run your own scripts (macros), which are created in plain text editors, such as Notepad or Notepad++.

    To use an existing script (this is assuming you have the *.ahk file):

    1. Save the *.ahk file to a folder in your computer. Double-click to activate it.

    2. Now that the script is active, press your hotstring or hotkey to trigger the actions in the script.

    –––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––

    To create a script from code you've found in the Community or somewhere else:

    1. Go to a folder in Windows Explorer where you would like to save your script (I have a folder called AutoHotkey Scripts just to keep them all in one place). Right-click on an empty space in the folder and select New, then AutoHotkey Script. Give a name to your script and save it.

    So far, you have the empty "skeleton" of a script. Now you need to paste the code you've found.

    2. Right-click on the script and select Open, then open it with a text editor, such as Notepad (I prefer Notepad++, available for free).

    3. Once the file is open, you will see that there's already some text in it. Paste the script code in a new line.

    4. Save the file. Now double-click the file, and this will load the script. Look for a green square with a white H in it in your system tray, which indicates that the script is active.

    5. Now that the script is active, press your hotkey* to trigger the actions in the script.

    *The hotkey is the key combination indicated before the pair of colons in the code. You can change this if you'd like to use a different hotkey than the one that came with the code you found. To interpret the hotkey, keep the following in mind:

    ^ = Control key

    ! = Alt key

    + = Shift key

    –––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––

    To create a new script from scratch:

    1. Go to a folder in Windows Explorer where you would like to save your script (I have a folder called AutoHotkey Scripts just to keep them all in one place). Right-click on an empty space in the folder and select New-AutoHotkey Script. Give a name to your script and save it.

    So far, you have the empty "skeleton" of a script. Now you need to enter the actions you want it to execute.

    2. Right-click on the script and select Open, then open it with a text editor, such as Notepad (I prefer Notepad++, available for free).

    3. Once the file is open, you will see that there's already some text in it. Enter the script code in a new line.

    4. Save the file. Now double-click the file, and this will load the script. Look for a green square with a white H in it in your system tray, which indicates that the script is active.

    5. Now that the script is active, press your hotkey to trigger the actions in the script.

  • Thanks.

    installation, done
    created file with your script
    buit to be able to invoke it from segment 1 of my Trados Editor context,
    shoudl I add a key(symbol) combination in the header
    i.e.
        #v:
        ^!
        InputBox
        ...

    ?

            JF

    ============

    file d:\code\nora.ahk

    ============

    #NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
    ; #Warn  ; Enable warnings to assist with detecting common errors.
    SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
    SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.


    #v::
    InputBox,Var,Paste one sentence per segment (by Nora Díaz), How many times do you want to run the sequence?
    loop, % Var
    {
    Send ^{PgUp}
    Sleep 100
    Send, ^f
    Sleep 200
    Send, \.
    Sleep 200
    Send !t
    Sleep 200
    Send !u
    Sleep 200
    Send !n
    Sleep 200
    Send !u
    Sleep 200
    Send {Esc}{Right}{Del}
    Sleep 100
    Send ^+{PgDn}
    Sleep 100
    Send ^x
    Sleep 100
    Send {Down}^v
    Sleep 200
    }
    Return

    ==================

    .
  • It's already included in the script. The hotkey is Windows key + v (represented by #v in the script, # being the Windows key).  So, once you have the cursor in the appropriate segment, press the Windows key and the v key. 

  • Nothing occurs.

    Shouldn't I have an autohotkey process or service running?

    Nothing is listed in Windows Task Manager.

    NB:
    Running Windows 7, 64 bit, Trados 2021
    Testing on a DE-FR text from Frankfurter Allgemeine Zeitung after copying the Deepl rendition.

  • Did you activate the script (by double-clicking on the file in Windows Explorer)? If the script is active, you should see an AutoHotkey icon in the system tray, a green square with a white H in it.

  • OK now.

    I had overlooked the "Now double-click the file".

    NB
    With my machine I could cut the delays to half or even less.
    My example runs into some misalignments of segments, but that's something else.

    Quite practical


    ¡Gracitas!


    JF

    www.argumentaires.com