Generate script with user template

Tests are fixed.