ScriptCS-GUI has evolved a little bit. At the moment the following helpers are declared inside the static class Gui.

Gui.OpenFileDialog(): open a classic Open File Dialog and return the path of the selected file.

Gui.SaveFileDialog(): act similar to OpenFileDialog()...

Gui.PopUp(): open a pop-up and returns a form object. You can use its Sta.Enqueue(action) method to inject code in the form's main thread (e.g. to add controls at runtime) while working inside the console!

Gui.Drawing(): open a drawing form and returns the Graphics object you can use to draw on the form (the console stays responsive in this case too!)

Probably the most useful thing is that I've managed to open Windows Forms from the console while leaving the console "alive responsive" (tipically the console would (in-)act like a zombie after any Application.Run() over the form!). This means that now you can go on using the ScriptCS console and send any command to any window you created FROM the console. This was not obvious and I've got lots of ideas about how to implement ScriptCS-GUI further! - Stay tuned :)

I'm going to write more about these in my next post. For now you can just launch the interactive script "gui-demo.csx", run it and - *hopefully* - send me some feedback :)

The interactive script "gui-demo.csx" lets you play with classic Windows Forms while the console stays responsive!

Beeing able to write and freely execute C# scripts is a great opportunity and can be a time saver. What I lack more at this stage of development of ScriptCs is a simple toolset to implement basic user interactions.
I've sterted a new project on GitHub called ScriptCS-GUI. At the moment it holds some vanilla C# scripts but I wish to evolve it to a full featured Script Pack.

As a starter I implemented classic interactions such showing an OpenFileDialog and a SaveFileDialog.
In the following example the Console asks the user to select a file and then writes the selected file name.

> #load "gui.csx" // var file = Gui.OpenFileDialog(); // file //

The following script shows you how to read a folder name from the command argument and use it with the Gui.OpenFileDialog helper.