Switch to Target Language After Adding Files to a Project

I wrote the script below to automatically switch to the target language (first in the Dropdown list, so it works great for bilingual projects) after preparing files newly added to an existing project.

After loading the script, you don't need to do anything else, the script will be triggered when you click OK in the Batch Processing window after completing your file preparation, switching to the target language.

Tip: I've noticed that the name of the control (WindowsForms10.COMBOBOX.app.0.29531c8_r9_ad14) is different between my desktop and laptop computers, so you may want to check yours and make the appropriate changes if the script doesn't work on your system.

;–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––-

;Automatically switch to target language after preparing files

;–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––-

 

#IfWinActive ahk_exe SDLTradosStudio.exe


~LButton::
IfWinExist, Batch Processing

{

WinWaitClose, Batch Processing

Sleep, 1000
Control, Choose, 2, WindowsForms10.COMBOBOX.app.0.29531c8_r9_ad14, ahk_class WindowsForms10.Window.8.app.0.29531c8_r9_ad1 ; Selects option 2
}

Return

Parents
  • Hi all,
    I’m obviously out of my league here, but could anyone give me a pointer (perhaps a link to a relatively easy-to-understand method) to determine the control names? In this specific case, I imagine only the “0.29531c8_r9_ad14” and “0.29531c8_r9_ad1” parts of the posted code should be changed to reflect the control names on my machine, correct?

  • Hi Yannic,

    Yes, certainly, I should have added that earlier. It's relatively easy.

    Go to the green H of one of your loaded AutoHotkey scripts, right-click it and select Window Spy.  With the Window Spy open, go to Studio and click on the dropdown menu where you change languages in the File view. You will see something like the sreenshot below.

    You can use the Windows key + A to freeze the the info displayed in Window Spy so you can move your mouse around and not have that info change. Then you can copy the control name to replace it in the script. In the screenshot, I've highlighted the control name I have.

    Once you've copied this info, replace it in the script above.

Reply
  • Hi Yannic,

    Yes, certainly, I should have added that earlier. It's relatively easy.

    Go to the green H of one of your loaded AutoHotkey scripts, right-click it and select Window Spy.  With the Window Spy open, go to Studio and click on the dropdown menu where you change languages in the File view. You will see something like the sreenshot below.

    You can use the Windows key + A to freeze the the info displayed in Window Spy so you can move your mouse around and not have that info change. Then you can copy the control name to replace it in the script. In the screenshot, I've highlighted the control name I have.

    Once you've copied this info, replace it in the script above.

Children