Read selection aloud for comprehension and quality checking

Hi,

I would like to share a simple ahk script which I find helps me with understanding the source easily and then quality checking the target I have written. Its especially useful for long segments.

The script makes use of the immersive reader in Word. To use it you will need to have open the immersive reader in Word (under View) and Trados.

Select the text you want to have read aloud then hit F1 (or your desired hotkey)

F1:: ;read aloud
{

SetTitleMatchMode, 2
clipboard=
Sleep, 50
sendInput, ^c
Sleep, 50
WinActivate, Word
Sleep, 150
sendInput, ^a
Sleep, 50
sendInput, {Enter} ;to avoid the text being obscured by the play dialog box in Word
Sleep, 50
sendInput, ^v
Sleep, 50
sendInput, ^{home}
Sleep, 150
sendInput, ^!{space} ;this tells Word to read the text aloud
Sleep, 150
sendInput, ^!{space} ;for me, I found I need to run this command twice to work stably for both source and target languages
return
}

Parents
  • I made use of Adrian's suggestion. With these two scripts you can read the source and target aloud directly in Trados. This may be an easier method than pasting to Word every time.

    F1:: ;read source
    {
       clipboard=
       sleep, 50
       sendInput, ^c
       sleep, 50
    voice := ComObjCreate("SAPI.SpVoice")
    voice.Voice := voice.GetVoices().Item(0) ;Change the item number here to choose which voice to use (See control panel, ease of access to see which voices you have installed on your computer)
    voice.Rate :=-1 ;make the source a little slower. This can be change between -10 and 10.
    voice.Speak(clipboard)
    return
    }

    F2:: ;read target
    {
       clipboard=
       sleep, 50
       sendInput, ^c
       sleep, 50
    voice := ComObjCreate("SAPI.SpVoice")
    voice.Rate := 3 ;make the target a little quicker
    voice.Voice := voice.GetVoices().Item(1)
    voice.Speak(clipboard)
    return
    }

Reply
  • I made use of Adrian's suggestion. With these two scripts you can read the source and target aloud directly in Trados. This may be an easier method than pasting to Word every time.

    F1:: ;read source
    {
       clipboard=
       sleep, 50
       sendInput, ^c
       sleep, 50
    voice := ComObjCreate("SAPI.SpVoice")
    voice.Voice := voice.GetVoices().Item(0) ;Change the item number here to choose which voice to use (See control panel, ease of access to see which voices you have installed on your computer)
    voice.Rate :=-1 ;make the source a little slower. This can be change between -10 and 10.
    voice.Speak(clipboard)
    return
    }

    F2:: ;read target
    {
       clipboard=
       sleep, 50
       sendInput, ^c
       sleep, 50
    voice := ComObjCreate("SAPI.SpVoice")
    voice.Rate := 3 ;make the target a little quicker
    voice.Voice := voice.GetVoices().Item(1)
    voice.Speak(clipboard)
    return
    }

Children
No Data