This topic is for memoQ 8.7. Have an older version? Click here.

Edit template: Scripting to transform documents before importing and after exporting

Experts only: Don't proceed if you're not familiar with scripts, programs, services, and users in Windows. If you don't have this experience, you need to call an expert, possibly an IT specialist.

Some documents must be transformed before you can import them into memoQ. This is done in project templates, through scripting.

Can't do this without templates: You can do this in projects created from project templates only.

When it's already in a project, it works like this:

  1. You import a document in the project.
  2. memoQ automatically runs the document through a program. That produces another, transformed, document. This step is called pre-processing.
  3. The transformed document is imported in the project.
  4. You work on the transformed document.
  5. When you export the document, you'll get a transformed document with the translations.
  6. Then memoQ runs the exported document through another program, which transforms it back to the original format. This step is called post-processing.

    Here's an example:

This Help documentation is written in a program that produces the Help pages in XML format. But if you import these XML files directly, the segments - sentences - will be fragmented, and you need to join every second segment with the next one to get sensible sentences.

There's a program that turns these XML files into slightly different XML files, where the fragments are already joined together. We import and translate these slightly different XML files. After they're exported, they must be transformed back, so that the authoring program can open them again. So they are run through another program that splits the segments apart again into the fragments. (Technically speaking, the same program is run with different arguments, but it could just as well be a completely different one.)

You need to set this up in a project template. Then the transformation will work in all projects that you create from this project template.

Set up your server first: If you need this for online projects, you must set up your server first. This is described in the What can you do? section, later in this topic.

You need to write or acquire the program: memoQ doesn't come with programs that transform documents. Either you need to write these, or acquire them from a programmer. Or, you can turn to memoQ Professional Services, who will write it for you for a fee.

To prepare or touch up text documents, use the built-in Find and replace tool: To learn more, see the topic about the Find and replace script.

How to get here

Open Resource console. Choose Project templates.

To set up a template for online projects: Use an online template for this. Choose your memoQ server at the top of Resource console. Click Select.

Select the project template that you want to set up with import and export scripts. Right-click the selection, and click Edit.

In the Edit project template window, choose Automated actions. Click the Scripts before import tab to set up the transformation that runs before the documents are imported. Click the Scripts after export tab to set up the transformation that runs after the documents are exported. You will probably need both.

What can you do?

When you finish

To save the project template, and return to Resource console: Click OK.

Possible next step: After you finish working on the template, close the Resource console, and create a project from the template.

To continue working on the project template: choose another category, and fine-tune other settings.

To return to Resource console, and not save the project template: Click Cancel.