Script to generate a new form

Script to generate a new form

Hi All,

Is it possible to generate a new form and view by scripting?

I have an application where the user will enter a name for the new form and somehow I'd like this to be created On Success. 

Alternatively, I could have a template form and somehow script that it should be copied and renamed to the name the user entered.

I'm stuck :)

Any help, hugely appreciated!!