Inspired by the discussion in this thread: http://www.proz.com/forum/sdl_trados_support/133592-how_to_save_as_utf_8-page2.html I have whipped up a small script for Autohotkey, which presents the found terms in a nice window, and allows to insert them with a single shortcut (Alt+number in the first column). The script takes the default Open segment shortcut (Alt+Home), naturally you can change it, but then also change the sequence sent after that (so that TagEditor/Word responds correctly). It took me about four hours, imagine what a real programmer could do with that software Naturally, all comments and suggestions are welcome. (BTW, I tried to make the columns resize automatically when the window is resized, but could not do that... Too little experience with AHK GUI, I'm afraid...). Here's the code: Code:
|
; TermCuts ver. 1.0
; Author: Jaroslaw Michalak
;
; Script Function:
; Display and insert terms from Multiterm
;
#Include ws4ahk.ahk
WS_Initialize()
WS_Exec("Set oWorkbench = GetObject(, ""TW4Win.Application"" )" )
Gui +Resize
Gui, Add, ListView, xm r15 w440 vMyListView gMyListView, #|Source|Target
Gui, Show
LV_ModifyCol(1, 30)
LV_ModifyCol(2, 200)
LV_ModifyCol(3, 200)
!Home::
Send !{home}
sleep 3000
; The sleep command is necessary, as MultiTerm is not very fast...
; The exact value depends on the termbase size, I suppose, so
; you might lower the value if you see that you get the terms in
; WB faster than in the AHK window.
LV_Delete()
WS_Eval(count, "oWorkbench.TranslationMemory.TranslationUnit.TermCount" )
Loop %count% {
WS_Eval(found, "oWorkbench.TranslationMemory.TranslationUnit.Term.Found" )
WS_Eval(target, "oWorkbench.TranslationMemory.TranslationUnit.Term.Target" )
LV_Add("", A_Index, found, target)
WS_Exec("oWorkbench.TranslationMemory.TranslationUnit.Term.Next" )
}
return
!1::
LV_GetText(Inserted, 1, 3)
Send %Inserted%
return
!2::
LV_GetText(Inserted, 2, 3)
Send %Inserted%
return
!3::
LV_GetText(Inserted, 3, 3)
Send %Inserted%
return
!4::
LV_GetText(Inserted, 4, 3)
Send %Inserted%
return
!5::
LV_GetText(Inserted, 5, 3)
Send %Inserted%
return
!6::
LV_GetText(Inserted, 6, 3)
Send %Inserted%
return
!7::
LV_GetText(Inserted, 7, 3)
Send %Inserted%
return
!8::
LV_GetText(Inserted, 8, 3)
Send %Inserted%
return
!9::
LV_GetText(Inserted, 9, 3)
Send %Inserted%
return
MyListView:
return
GuiSize: ; Expand or shrink the ListView in response to the user's resizing of the window.
if A_EventInfo = 1 ; The window has been minimized. No action needed.
return
; Otherwise, the window has been resized or maximized. Resize the ListView to match.
GuiControl, Move, MyListView, % "W" . (A_GuiWidth - 20) . " H" . (A_GuiHeight - 40)
return
|
|
[Edited at 2009-04-27 15:13 GMT] ▲ Collapse | |