Call RunScript not from Rhino Command

Good morning.
I need to call RunScript like

RhinoApp.RunScript(string.Format("_-Open \"{0}\" _Enter", filename), false);

but not from Rhino Command, rather from any part of the plugin code.
Simple command call not work of course, but I think the command style attribute is specific for Rhino Command definition.

How can I make the call work?

Have you tried calling it?

Once the command you are running has the attribute, you can call it from anywhere inside your code.

If I try to call it from an event, I don’t have any error, but the command don’t run.

private void CodeDocumentDataGridView_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
{
            Rhino.RhinoApp.RunScript(string.Format("_-Save \"{0}\" _Enter",
                CodeDocumentDataGridView.SelectedRows[0].Cells[0].Value.ToString()), false);
}

Hi @Noos,

There is no reason that RunScript shouldn’t run from a WinForms control event.

For more assisting, you might consider posting a sample project that isn’t working for you.

– Dale