SaveAs command with an argument instead of SaveFileDialog Dialog

Hi - I would like to add an argument to one of my commands which is a filename (to save to). At the moment the command pops open the SaveFileDialog when the user types the command, however I would like to give them the option to enter the filename on the command line. Is this possible pls? I searched through https://github.com/dalefugier/SampleCsCommands but couldn’t find anything that did this.

Thanks

Paul

For others who have this requirement, the solution is something like:

                var gs = new GetString();
                gs.SetCommandPrompt("Enter filename (.PNG/.EXR)");
                gs.AcceptString(true);
                if (gs.GetLiteralString() == GetResult.String)
                {
                    string filename = gs.StringResult();
                    if (filename != "")
                    {
                        OctaneWrapper.SaveImage(filename, UiManager.GetConfiguration().m_ConfigurationData.FileSaveFormat, UiManager.GetViewportForm().GetCurrentRenderPass());
                    }
                }

Here is some sample code that is a little different. This takes both scripted and interactive modes into account.

https://github.com/dalefugier/SampleCsCommands/blob/master/SampleCsSaveAs.cs

– Dale

Thanks Dale - very useful. Much appreciated.

Paul