Conditional scripts generation

Apparently a major work, actually a small thing...