
OmTaddterm (v2.1 (with UTF-8 support))
by Samuel Murray (July 2007)
http://www.leuce.com/translate/
http://www.leuce.com/tempfile/omtautoit/

==

You need AutoIt installed, or you can use the compiled exe file (but if you use the exe file, you have to have your OmegaT glossary path as C:\Omtaddterm and that the glossary file is named glossary.utf8).

You must also have the file tabchar.txt in the same folder as the OmTaddterm script. It contains a single tab character, which is grabbed by the script when adding terms.  When the script shows you the term to be added, the tab may appear as a little square character.

This works on my computer, but it might not work on yours.  Bite me.

==

Usage:

Highlight the source term
Press Ctrl+Alt+T
Highlight the target term
Press Ctrl+Alt+Y

The script works in any program that is clipboard aware (OmegaT, Notepad, your browser, your e-mail program, even a Windows file dialog box).

Edit the term in the term add box (screenshot 1).  Everything before the first tab is the source term, everything between the first and the second tab is the target term, and everything after the second tab is an optional comment.  It's safe to delete the second tab character.  If you delete both tab characters by mistake, just press Cancel and add the term again.

Easter egg!  Highlight the word "coffee" and press Ctrl+Alt+C, and the script will make you a cup of coffee (may be buggy on certain platforms).  Joke, sorry.

==

Issues:

Everytime you press Cancel, a blank line will be written to the glossary.  Terms are added to the bottom of the glossary.

The script writes each term pair temporarily to a file named termtemp.txt and then deletes the contents of that file, so don't have a file with that same name containing critical data in the same directory as the script :-).

The script will stay resident until you kill it by right-clicking on the icon in the systray and select Exit.

The script won't warn you if you try to launch it twice (I can probably write that into the script, but simple is better, and you're not stupid).

If you're using this script with OmegaT 1.7.1 or similar, remember that OmegaT will only recognise new glossary terms when you've reloaded the project, although terms added in the mean time will not be lost.

If you can't see the Unicode letters in the edit box, then you're in the same boat as I am, so perhaps there's something wrong with your and my version of MS Windows. But I've had reports from people for whom the bell doesn't toll, so there.

Ooh, important one:  I think there is a limit of something like 256 characters to a glossary entry... not sure.  So if you really need to add very long comments, perhaps you should do it in Notepad.

You can edit tabchar.txt if you want, y'know.  If you want to have a different delimiter than a tab.  And, if the script doesn't work for you, try recreating the tabchar.txt in a UTF-8 editor :-)

==

Tell me what you think (or tell me if it works for you)!

==

Version history:

June 2006:
* Script is written

October 2006:
* Bug fixed: copy command is paused 1/10 of a second to ensure that the clipboard can't resist it
* Added startup message
* Added support for 3 column glossaries

July 2007
* UTF-8 support added
