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 Reply
  • This is a way to make variable length highlights without any border.

    With this, you can make as many boxes as you like so it essentially gives you a highlighter pen you can use anywhere on the screen. 

    Additional highlighter colours could be done with additional hotkeys as required.

    There is probably a way to "toggle" the code so that one hotkey could be used for both the start and end points but I am not smart enough to figure it out.

    CoordMode, Mouse, Screen

    F5::
    global startxpos
    global startypos
    MouseGetPos, startxpos, startypos
    return


    F6::
    MouseGetPos, endxpos, endypos
    boxw:=endxpos-startxpos
    boxh:=20
    boxy:=startypos-10
    Gui, New
    Gui, +LastFound +AlwaysOnTop +Owner
    WinSet, Transparent, 75
    Gui, +LastFound -Caption -Border ToolWindow
    Gui, Color, FF00FF
    Gui, Show, W%boxw% H%boxh% X%startxpos% Y%boxy%
    return


    F4::reload

Children