Double Movable Sentence Highlighters

Hi all,

A problem I had with comparing source and target sentences, especially for longer sentences, was losing my place in the sentence as I switched between looking at the two.

So, I created this script to make two "highlight bars" that you can place over the source and target sentences and move as you gradually work through the sentence.

I am finding it very useful so I wanted to share it.

This is the script

#i::
file1 = C:\Users\james\Desktop\Work\yellow-bar.jpg ; insert your filepath here
file2 = C:\Users\james\Desktop\Work\pink-bar.jpg ; insert your filepath here
Gui, New
Gui, Add, Picture,, %file1%
Gui, +LastFound +AlwaysOnTop -border -caption
WinSet, Transparent, 100
Gui, Show
Gui, New
Gui, Add, Picture,, %file2%
Gui, +LastFound +AlwaysOnTop -border -caption
WinSet, Transparent, 100
Gui, Show

These are the images I use but you could use any image at all:

A plain yellow rectangular image used as a highlight bar in Trados Studio.

A plain pink rectangular image used as a highlight bar in Trados Studio.

To use this script you will need to also use this additional script:

GitHub - Hurstwood/Linux-style-mouse: An AHK (AutoHotKey) script that allows the user to move a window by grabbing it anywhere within the window.

With this, you can move the two highlight bars by holding down Alt and dragging.

Example of use:

Screenshot of Trados Studio interface showing source and target text comparison with yellow and pink highlight bars over the text.

To get rid of the highlight boxes, just reload the script.



Generated Image Alt-Text
[edited by: Trados AI at 4:26 AM (GMT 0) on 5 Mar 2024]
emoji
Parents
  • Nice one!

    A couple of enhancements:

    - No need of JPG's

    - Width, height, and colours are customisable

    - Yellow transparent window is placed at the cursor position

    - Pink window is placed close to the yellow one

    - No icons in the task bar re. the 2 transparent windows

    #i::
        CoordMode, Mouse, Screen
        MouseGetPos, x0, y0
        
        Gui, New
        Gui, +LastFound +AlwaysOnTop +Owner
        WinSet, Transparent, 50
        Gui, +LastFound -Caption
        Gui, Color, FFFF00 ; yellow
        Gui, Show, W250 H30 X%x0% Y%y0%
        
        Gui, New
        Gui, +LastFound +AlwaysOnTop +Owner
        WinSet, Transparent, 50
        Gui, +LastFound -Caption
        Gui, Color, FF00FF ; pink
        x0+= 100
        y0+= 10
        Gui, Show, W250 H30 X%x0% Y%y0%
    return

  • I added "+Resize" so that you adjust the size of the box to match the length of the sentence clause you are looking at

    #i::
    CoordMode, Mouse, Screen
    MouseGetPos, x0, y0

    Gui, New
    Gui, +LastFound +AlwaysOnTop +Owner
    WinSet, Transparent, 75
    Gui, +LastFound -Caption +Resize
    Gui, Color, FFFF00 ; yellow
    Gui, Show, W250 H30 X%x0% Y%y0%

    Gui, New
    Gui, +LastFound +AlwaysOnTop +Owner
    WinSet, Transparent, 75
    Gui, +LastFound -Caption +Resize
    Gui, Color, FF00FF ; pink
    x0+= 100
    y0+= 10
    Gui, Show, W250 H30 X%x0% Y%y0%
    return

Reply Children