Templates

Templates provide a way to create a form in Easy Automation that can be used to generate blocks of similar text. The templates have fields in them can either be filled in by automation scripts, or the user of an automation script. You can see templates in action in a number of places in Easy Automation. Most blocks are just templates that generate a script after asking the user for some information.

The test everything script (test.eaf) contains a couple of example of how to use templates, including how to abuse a template in order to ask the user

The basic format for a template is a follows:
<template orderby='' name='' description=''>
	<![CDATA[
	    Put the body of the template here
	]]>
	<variable priority='' name='' type='' value='' required=''
	description='' />
</template>
The template tag surrounds the entire definition of the template. It has the following properties: The CDATA section contains the body of the template. It contains normal text plus some special tags: The variable tag is used to define all the variables. It has the following properties: To use the template in a script you use the Template class. The code would look something like:
var template = new Template( "Template XML goes here" );
template.setVariable( "name", "value" );
var resultString = template.Expand( false );
For another example of see the test script.