# Dialog-type notebook

I have the following dialog to calculate the product of a and b:

CreateDialog[ Column[{InputField[Dynamic[a], Number, FieldHint -> "enter a"], InputField[Dynamic[b], Number, FieldHint -> "enter b"], Button["run", MessageDialog[ToString[a b]]], Button["Close", DialogReturn[]]}]];

Upon execution of this cell, it works exactly the way I need, giving this:

Is there a way that this dialog appears without opening the notebook? I just want to double-click on the notebook file and see the front end and this dialog appearing. Any help appreciated!

• No, I mean .nb.
– Kuba
Mar 31, 2015 at 18:52
• you mean save the dialog as a notebook that you subsequently click on and open directly? Try NotebookSave Mar 31, 2015 at 22:58

FileNameJoin[{$TemporaryDirectory, "myDialog.nb"}], CreateDialog[ Column[{ InputField[Dynamic[a], Number, FieldHint -> "enter a"], InputField[Dynamic[b], Number, FieldHint -> "enter b"], Button["run", MessageDialog[ToString[a b]]], Button["Close", DialogReturn[]]}]] ]; SystemOpen @$TemporaryDirectory