Automatic saving svg files via C# Script from Grasshopper

Hi all,

I have written a C# script in Grasshopper based on the video of Junichiro Horikawa (How to Export Geometry in Grasshopper using C# - YouTube). What the script does is select elements and then export them via “Export selected”. The whole thing works fine for most formats (.obj, .fbx …) but the export process always gets stuck for .svg. Here I always get the export window again where I have to press enter manually. I already tried to put many enter commands into the cmd prompt but without success.

The export window which needs be confirmed again:

A part of the script which should export the data:

Has anyone here ever had similar experiences and know what I’m doing wrong?

separate “_Enter_Enter”.
to “_Enter” + “_Enter”