Click or drag to resize
Setting up the Visual Studio Project

To start setting up your batch task plug-in project, you need to generate a plug-in that can compile and that implements an empty batch task which can be seen and selected in SDL Trados Studio. For the moment, it will not contain any application logic, that is it will not actually perform a real task.

How to create the Visual Studio Project

Assuming that you already installed the SDL Trados Studio SDK, open Microsoft Visual Studio. You will see the following options when you create a new project:

Custom Batch Template
With the above templates you can set up the skeleton of an SDL Trados Studio plug-in project. Select SDL Custom Batch Task Plug-in 2015.

The Plug-in Skeleton

The plug-in template will add the required references to your project:

References
It will also add the following skeleton classes to your project:
Stubs

The Plug-in Declaration: ID, Name, Description

Open the MyCustomBatchTask.cs class. This class contains the plug-in declaration - the plug-in name and description that will be visible inSDL Trados Studio:

Plug-in Declaration
// Plug-in is declared to Studio with is, name and description
// Furthermore, you declare the type of file that is processed with this plug-in
// This sample plug-in works on bilingual SDL XLIFF files, i.e. not on native source files
[AutomaticTask("My_Custom_Batch_Task_ID", "My_Custom_Batch_Task_Name", "My_Custom_Batch_Task_Description",
    GeneratedFileType = AutomaticTaskFileType.BilingualSource)]
Give the batch task plug-in a new name, ID and description. Instead of doing it directly inside this class, enter the strings into the PluginResources.resx file:
Resource
Note that you also declare what kind of files the batch task works on here. Most batch tasks are used to process bilingual SDL XLIFF files, not native files such as DOCX or PPTX. This also applies to our sample implementation.

In this class, you also reference the settings page that allows the user to configure the batch tasks settings via the plug-in UI:

The UI Settings Page Reference
// References the settings page, i.e. the UI in which the user can configure plug-in settings
[AutomaticTaskSupportedFileType(AutomaticTaskFileType.NativeSource)]
[RequiresSettings(typeof(MyCustomBatchTaskSettings), typeof(MyCustomBatchTaskSettingsPage))]

The Plug-in Build Folder

Make sure that you sign your assembly. Then build the assembly. The project is automatically configured to build the plug-in file into the folder: %AppData%\Roaming\SDL\SDL Trados Studio\12\Plugins\Packages\. After you have built the plug-in, you should find the file SDL Custom Batch Task Plug-in 2015.sdlplugin. Now start SDL Trados Studio. Because the plug-in is not yet officially signed by SDL, you will see the following message after you start the application:

Plugin Not Signed
For the moment, ignore this message. Click Yes to make sure that SDL Trados Studio extracts the plug-in file. Once Studio is started, you should find the sub-folder SDL Custom Batch Task Plug-in 2015 under %AppData%\Roaming\SDL\SDL Trados Studio\12\Plugins\Unpacked\. This sub-folder contains the unpacked plug-in assemblies.

In the batch tasks list of SDL Trados Studio, you will see the name of your newly compiled plug-in:

Sample Task Name

When you select your sample batch task you will see the following window with the plug-in description:

Sample Task Description

At this point your batch task is not actually doing anything, but as a first step you have managed to integrate your plug-in into SDL Trados Studio. In the following pages, we will enhance this basic plug-in with some added functionality. Close SDL Trados Studio and go back to your Microsoft Visual Studio project.