47
Compilation Prompts
There may be times that you do not want sensitive data such as user IDs or passwords to appear in the
script for others to see. In this case, you can prompt for the data during script compilation. This data is
not visible in the script itself and is only stored in the compiled script, which is not readable.
To use this feature, use the prompt directive:
#prompt{prompt msg}
The prompt message you want displayed is placed between the braces ( {} ). You cannot use a string
variable here and the text should not be in quotes. The value returned by the prompt is a string and
contains the text entered by the user.
The prompt can be place anywhere a string is expected, such as:
FTPget.username = #prompt{Enter you FTP username
}
If the prompt is used where an integer is needed, assign a string to the value returned by the prompt
and then use the AsInt method. For example:
string copies = #prompt{Enter number of copies}
PrintIP.copies = copies.AsInt()
Compilation prompts are used in several of the example scripts included with the Document Server.
This allows you to enter information specific to your organization in the scripts prior to compiling them.
For example, the script below uses compilation prompts to allow you to enter an e-mail server and
addresses that will work in your organization. Notice how the Server, To, and From, properties are
specified.
with EmailSMTP
.Server=#prompt{Enter the IP address or DNS hostname of the SMTP server
:
}
.To=#prompt{Enter the TO e-mail address:}
.From=#prompt
{
Enter the FROM e-mail address:
}
.Subject="Scanned Attachment"
.Message="Here is the document you scanned."
.Attachments=original.document
.CharacterSet=LDD_SMTPCHARSET_US
.Go()
endwith
Summary
You have now seen some of the features of the Script Editor. In addition, you have seen how to add
Actions to an existing script using either the Insert Actions Wizard, or by adding them manually. You
are now ready to learn some more advanced scripting options by using flow control.