Saving/Restoring user defined string filters

Hello,

I created a C# tool for automation of our Passolo related workflows. For the automated translation process we need some specific/different Passolo settings (options).

Therefore...

1) When the tool starts I save all current Passolo setting via COM instruction objPSL.Option[-number].

2) Then I change some settings that are required for the translation process.

3) Before the tool ends I restore the formerly saved settings to have Passolo in the same state as before.

Unfortunately, there seems to be no possibility to save/restore existing user defined string filters via COM instructions.

The only workaround I have found so far is to save the user defined string filters in a separate .pslopt file via the export options dialogue (but that is a manual process step I want to avoid) and then to import the filter settings via COM instruction objPSL.ImportOptions[file name] again.

I know there exists a BATCH instruction for saving all options (including user defined string filters), but I want to avoid calling batch instructions inside the C# code.

Apart from that the .pslopt file is not always properly saved using the batch command.

Is there any possibility to save/restore user defined string filters via COM command?

emoji
Parents Reply
  • For a final solution I had to add two additional process steps.

    1) I noticed that project filter settings get also lost. Project filter settings are automatically stored by Passolo in file prjfilters.dat in the same folder as filters.dat. Therefore it's required to make also a copy of prjfilters.dat when the tool starts and then create a filters.opt file that contains both string and project filter settings.

    2) I also noticed that I need to explicitely encode the filter setting texts to USC-2 LE-BOM (UTF-16) when storing them in filters.opt file. Otherwise German umlauts get lost when importing filters.opt file again and lead to ugly texts in the filter dialogues.

    These two steps were also fairly simple to implement. Now everything work as desired.

    emoji
Children
No Data