Select Template and Generate Script Code