How to close option window in runscript?

Hello everyone,

can you know, how I can hide Grasshopper options in runscript? I’m trying to open Grasshopper in batch modus with RunHeadless method. But, I can’t close Grasshopper Option menu, therefore I can’t export geometries.

I could solve the problem using changing value in a Grasshopper panel via C#. But, I’m using OnOff Component from MetaHoppe and the panel idea doesn’t work with disabled objects. I thought, maybe the code changes the panel very quickly and therefore, it doesn’t work. Then, I added a thread sleep method in the code. However, I have still the same problem.