How to support this blog?

To support this blog, you can hire me as an OmegaT consultant/trainer, or you can send translation and project management jobs my way.

Search the site:

TextEdit to TMX!!!

April 14 2023: the script has been updated to fasten the array process by using Shane Stanley's Bridgeplus.


I've just adapted my 'Excel to TMX' script so that it works with a number of files opened in TextEdit windows instead.

https://github.com/brandelune/OmegaT-things

Use case:

  • you have contents in a number of languages, and the contents are aligned (i.e. each line is a language variation of the lines at the same position in the other files)
  • you want to use all that in OmegaT, or any other TMX supporting tool
  • so you want to glue all that into a nice and simple TMX
  • but you also don't want to use Excel, because it's too cumbersome, or because the data has quotation marks that Excel interprets as

Solution:

  1. Copy one language content in a file, the other language in another file (in a different window), etc. The documents do not have to be saved or named. Just create new windows as necessary and paste your contents.
  2. Run the script
  3. It will ask you for the language of the contents in the first window, then in the second window, etc.
  4. Use valid TMX language codes there, because the strings you enter will be the ones used in the TMX
  5. The script displays a progression dialog,
    and at the end, boom, the TMX is created on your Desktop with a timely name like this: TextEdit2tmx_20211219T071214Z.tmx

I've run it with ~ 500 segments in 2 windows (2 languages) and it took me about 5 seconds to create the TMX. It does not really seem to matter how many characters there are in the documents. What seems to matter is the number of lines (segments), and windows.

Also, the segmentation is exactly one segment per line. So you just create a TMX from contents that's segmented and you know is aligned.

Popular, if not outdated, posts...

.docx .NET .pptx .sdf .xlsx AASync accented letters Accessibility Accessibility Inspector Alan Kay alignment Apple AppleScript ApplescriptObjC AppleTrans applications Aquamacs Arabic archive Automator backup bash BBEdit Better Call Saul bug Butler C Calculator Calendar Chinese Cocoa Command line CSV CSVConverter database defaults Devon Dictionary DITA DocBook Dock Doxygen EDICT Emacs emacs lisp ergonomics Excel external disk file formats file system File2XLIFF4j Finder Fink Font français Free software FSF Fun Get A Mac git GNU GPL Guido Van Rossum Heartsome Homebrew HTML IceCat Illustrator InDesign input system ITS iWork Japanese Java Java Properties Viewer Java Web Start json keybindings keyboard Keynote killall launchd LISA lisp locale4j localisation MacPort Mail markdown MARTIF to TBX Converter Maxprograms Mono MS Office NeoOffice Numbers OASIS Ocelot ODF Okapi OLPC OLT OmegaT OnMyCommand oo2po OOXML Open Solaris OpenDocument OpenOffice.org OpenWordFast org-mode OSX Pages PDF PDFPen PlainCalc PO Preview programming python QA Quick Look QuickSilver QuickTime Player Rainbow RAM reggy regular expressions review rsync RTFCleaner Safari Santa Claus scanner Script Debugger Script Editor scripting scripting additions sdf2txt security Services shell shortcuts Skim sleep Smultron Snow Leopard Spaces Spanish spellchecking Spotlight SRX standards StarOffice Stingray Study SubEthaEdit Swordfish System Events System Preferences TBX TBXMaker Terminal text editing TextEdit TextMate TextWrangler The Tool Kit Time Capsule Time Machine tmutil TMX TMX Editor TMXValidator transifex Translate Toolkit translation Transmug troubleshooting TS TTX TXML UI Browser UI scripting Unix VBA vi Virtaal VirtualBox VLC W3C WebKit WHATWG Windows Wine Word WordFast wordpress writing Xcode XLIFF xml XO xslt YAML ZFS Zip