Thanks Jaime, def userful links, and you are right i am a bit confused about a few things, but the links helped alot.
I do follow the steps to create a new smart app from a code, and this is what i get
No signature of method: script1453589777097562582541.metadata() is applicable for argument types: (script1453589777097562582541$_run_closure1) values: [script1453589777097562582541$_run_closure1@7b5f075e] Possible solutions: getMetadata(), getState(), setState(java.lang.Object), metaClass(groovy.lang.Closure)
And when i create a smart app from form, then select my apps in category then i get this error
groovy.lang.MissingMethodException: No signature of method: script1453590021460789358803.metadata() is applicable for argument types: (script1453590021460789358803$_run_closure1) values: [script1453590021460789358803$_run_closure1@546a6d02]
Possible solutions: getMetadata(), getState(), setState(java.lang.Object), metaClass(groovy.lang.Closure)
Thoughts?