OK. You want it done programmatically. Your reference to automatically was a little ambiguous.
I don't do a lot of Notebook programming, but as a very basic start you could try something like the following.
NotebookWrite[InputNotebook[],
Cell[BoxData[
RowBox[{"Plot", "[",
RowBox[{ TagBox[FrameBox["f"], "Placeholder"], ",",
RowBox[{"{",
RowBox[{ TagBox[ FrameBox["x"], "Placeholder"], ",",
TagBox[ FrameBox["xmin"], "Placeholder"], ",",
TagBox[ FrameBox["xmax"], "Placeholder"]}], "}"}]}],
"]"}]], "Input"]]
For more details, you can look under Notebooks and Documents in the Documentation Center.