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 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 Visual Studio extension Trados Studio templates, open Microsoft Visual Studio 2022. You will see the following options when you create a new project:
With the above templates you can set up the skeleton of an Trados Studio plug-in project. Select *Custom Batch Task (2021)
The Plug-in Skeleton
The plug-in template will add the required references to your project:
It will also add the following skeleton classes to your project:
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 in Trados Studio:
// 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 SDLXliff 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:
Note
You also declare what kind of files the batch task works on here. Most batch tasks are used to process bilingual SDLXliff 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:
// 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%\Trados\Trados Studio\18\Plugins\Packages\ . After you have built the plug-in, you should find the file Custom Batch Task1.sdlplugin. Now start Trados Studio. Because the plug-in is not yet officially signed by RWS, you will see the following message after you start the application:
For the moment, ignore this message. Click Yes to make sure that Trados Studio extracts the plug-in file. Once Studio is started, you should find the sub-folder Custom Batch Task1 under %AppData%\Trados\Trados Studio\18\Plugins\Unpacked\ . This sub-folder contains the unpacked plug-in assemblies.
In the batch tasks list of Trados Studio, you will see the name of your newly compiled plug-in:
When you select your sample batch task you will see the following window with the plug-in 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 Trados Studio. In the following pages, we will enhance this basic plug-in with some added functionality. Close Trados Studio and go back to your Microsoft Visual Studio project.