TermCuts: Trados term viewing/insertion made easier...
Thread poster: Jabberwock

Jabberwock  Identity Verified
Poland
Local time: 18:49
Member (2004)
English to Polish
Apr 27, 2009

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]


Direct link Reply with quote
 

Jabberwock  Identity Verified
Poland
Local time: 18:49
Member (2004)
English to Polish
TOPIC STARTER
Required script... Apr 27, 2009

Forgot to add that you need to download the ws4ahk.ahk script from here:

http://www.autohotkey.net/~easycom/

and put it with my script (or specify full path in the #include directive).


Direct link Reply with quote
 

Grzegorz Gryc  Identity Verified
Local time: 18:49
French to Polish
+ ...
Wow... Apr 27, 2009

Jabberwock wrote:

Forgot to add that you need to download the ws4ahk.ahk script from here:

http://www.autohotkey.net/~easycom/

and put it with my script (or specify full path in the #include directive).


Well, well...
It takes years Trados/Multiterm programmers were unable to switch to the term list view...

PS.
How many time you spent to write it?

Cheers
GG


Direct link Reply with quote
 

Jabberwock  Identity Verified
Poland
Local time: 18:49
Member (2004)
English to Polish
TOPIC STARTER
Not too long... Apr 27, 2009

Grzegorz Gryc wrote:
How many time you spent to write it?


As I wrote, it took about four hours, most of which I spent working out the intricacies of using Windows objects in AHK and getting to know the ListView options. I did not want to bother with Visual Basic or .Net Express, as it requires some bloatware, although it would be faster there.

Also, I have copped out by copying and replacing the number key code, I guess a loop would have been much more elegant, but as it was faster and it works, you cannot really blame me (blame MultiTerm ).


Direct link Reply with quote
 


To report site rules violations or get help, contact a site moderator:


You can also contact site staff by submitting a support request »

TermCuts: Trados term viewing/insertion made easier...

Advanced search







PDF Translation - the Easy Way
TransPDF converts your PDFs to XLIFF ready for professional translation.

TransPDF converts your PDFs to XLIFF ready for professional translation. It also puts your translations back into the PDF to make new PDFs. Quicker and more accurate than hand-editing PDF. Includes free use of Infix PDF Editor with your translated PDFs.

More info »
Across v6.3
Translation Toolkit and Sales Potential under One Roof

Apart from features that enable you to translate more efficiently, the new Across Translator Edition v6.3 comprises your crossMarket membership. The new online network for Across users assists you in exploring new sales potential and generating revenue.

More info »



Forums
  • All of ProZ.com
  • Term search
  • Jobs
  • Forums
  • Multiple search