Lexmark Document Distributor User Manual
Lexmark Document Distributor User Manual

Lexmark Document Distributor User Manual

Lexmark document distributor software: user guide
Hide thumbs Also See for Document Distributor:

Advertisement

Quick Links

Document Distributor
Basic Script Writing
April 2002
www.lexmark.com

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Document Distributor and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for Lexmark Document Distributor

  • Page 1 Document Distributor Basic Script Writing April 2002 www.lexmark.com...
  • Page 2 International Ltd., Marketing and Services Department, Westhorpe House, Westhorpe, Marlow Bucks SL7 3RQ. Lexmark may use or distribute any of the information you supply in any way it believes appropriate without incurring any obligation to you. You can purchase additional copies of publications related to this product by calling 1-800-553-9727.
  • Page 3: Table Of Contents

    Table of contents Introduction ... 1 Chapter 1: Your First Script ...2 Example of a work flow process ... 2 Using the ScriptWizard to write your script ... 4 EmailSMTP ... 8 ConvertToDocument ... 12 FaxByPrinter ... 15 Compiling your new script ... 18 Creating a Profile ...
  • Page 4 Chapter 3: Using the Script Editor ...39 Script Editor Toolbar ... 40 Adding an Action Using the Insert Actions Wizard ... 41 Add Actions Manually ... 45 Compilation Prompts ... 47 Summary ... 47 Chapter 4: Flow Control ...48 Conditional Statements ... 48 If/Then ...
  • Page 5: Introduction

    Introduction This document provides an introduction to writing scripts for the Lexmark Document Distributor (LDD) Version 2.1. It is assumed you are familiar with basic programming concepts and have some experience with a programming language such as C, C++, or Visual Basic. For a detailed technical specification of the scripting language, see the “Script Reference”.
  • Page 6: Chapter 1: Your First Script

    Your First Script To unleash the power of Document Distributor you need to create a script. To create a script you will need to understand the business process that you want to automate. Processes that are rarely performed or procedures that require a large amount of human intervention throughout the process probably aren't good candidates for Document Distributor automation.
  • Page 7 Now look at the Actions provided by Document Distributor and see how they match up with the example process. Route Documents EmailExchange EmailNotes EmailSMTP FaxByPrinter GWMail LaunchExe Manipulate Documents ConvertImageFormat ConvertToDocument ImageCombine ImageCrop ImageDeskew ImageInvert ImageMerge ImageRotate ImageSeparate ImageText In the hospital example, you need to break down the Document flow and then pick the Actions that...
  • Page 8: Using The Scriptwizard To Write Your Script

    Using the ScriptWizard to write your script The ScriptWizard helps you quickly create scripts to automate your workflow. Start the ScriptWizard by clicking the ScriptWizard icon A Dialog box appears listing the steps to take to create a script. Click Next. Choose which Document Server will process this script.
  • Page 9 Give your script a name. This is the name your end users see when selecting a profile from an MFP or workstation. The name can be up to 15 characters long. You may also provide a longer description to help identify this work flow process. This description can be seen by end users who submit jobs from a workstation through Select'N'Send or Print'N'Send.
  • Page 10 In the “Example of a work flow process” on page 2, the end user will scan the list of job openings or submit the list using Print'N'Send, so select Yes, a document is required for this job. No user data is needed in this script. To learn more about user data, see “User Data” on page 55.
  • Page 11 Select the Actions. Choose which Actions will be used in your script. For this example, you need one e-mail Action, one conversion Action, and one fax Action. • Select EmailSMTP. Click Add. • Select ConvertToDocument. Click Add. • Select FaxByPrinter. Click Add. There are now three Actions in your script.
  • Page 12: Emailsmtp

    EmailSMTP In order to send e-mail, you need to specify some properties. Click on each of the following to specify the property. • Server • • From • Subject • Message • Attachments Click the Server Property. This property indicates the mail server that sends the e-mail. Select Use value specified, and type in the name of the mail server.
  • Page 13 Click the To property. This property indicates to whom the e-mail is sent. Select Use value specified, and type in the recipient of the e-mail. Click the From property. This property is the sender’s e-mail address. Select Use value specified, and type in the sender’s e-mail address.
  • Page 14 Click the Subject property. This string is the subject of the e-mail that is sent. Select Use value specified, and type in the subject.
  • Page 15 Click the Message property. This string is the text of the e-mail that is sent, along with any attachments. Select Use value specified, and type in the message. Click the Attachments property. This property indicates what documents to attach to the e-mail.
  • Page 16: Converttodocument

    This is the document originally scanned by the user. Note: Before using an action, check the “Script Reference” located at Start Lexmark Document Distributor Client, to see what kind of document is required for the Action. Programs...
  • Page 17 Click the Format property. This property specifies the file format of the output from this Action. Choose PostScript as the conversion format.
  • Page 18 Click the output property. This property specifies where to keep the output from this Action. Click Create a new variable called in order to create a new document variable. Type in PSDocument as the name of the new document. This document can be used in subsequent Actions.
  • Page 19: Faxbyprinter

    FaxByPrinter This Action is used to send a fax using a Lexmark MFP. The following properties need to be specified: • Input • IPAddress • FaxNumber • StationID Click the Input property. This is the document that will be faxed. Click on Use a variable or property, select the PostScript document created by the ConvertToDocument Action called PSDocument.
  • Page 20 Click on the IPAddress property. Provide the IP address or DNS name of the fax-enabled Lexmark printer to be used for faxing.
  • Page 21 Click the FaxNumber property. Enter the phone number of the receiving fax machine. Be sure to include any additional numbers such as prefixes to access an external phone line, or an area or country code. Click the StationID property. Enter a station ID to use for the fax. Click Next to finish your script.
  • Page 22: Compiling Your New Script

    Compiling your new script Click the Primary Server to see the new script. Notice the red square symbol on the script. This indicates that the script needs to be compiled before it can be used. Compiling turns your script into instructions that the Document Server understands.
  • Page 23 Click the script name to open the script. Compile the script, by clicking Compile in the toolbar above the script text. If there are any syntax problems with the script, they are displayed in the Errors and Warnings window below the script text. After the script has been compiled and any syntax errors corrected, you need to upload the script to the Server so it can be used.
  • Page 24: Creating A Profile

    Creating a Profile Profiles describe what kind of document should be scanned for use by a script. A profile contains: • Script name (so the Server knows what script to run) • Scan Settings (so the MFP knows how to scan the document) •...
  • Page 25: Using The Mfp Profilewizard

    Using the MFP ProfileWizard Click the New Profile icon opens the ProfileWizard. The opening dialog outlines the steps you'll take to create a profile. Click Next. Select the Server where the script resides and then select the script for which you want to create a profile.
  • Page 26 Choose the MFP on which to create the profile. Click Next. You can choose a shortcut to make it easier for your end users to access the profile. For this example, click Don't assign a shortcut for this profile. Click Next.
  • Page 27 Select settings that describe the type of documents that your end users will scan when using this profile. These settings include content, paper size, orientation, and duplex. The duplex choice only appears if the selected MFP has a duplex option. For this example, accept the default settings.
  • Page 28 Select the settings to determine how the document is saved. You can select from several formats: • TIFF • JPEG • • Since this script sends the file as an e-mail, select TIFF as the format to create when the document is scanned.
  • Page 29: Summary

    Click the MFP icon in the Server Admin to see the newly created profile. Your end users can now access the profile from the MFP operator panel. Summary You have now written a script using the ScriptWizard. It was created, compiled and saved to the server. At that point, the script could be used from a workstation using Print'N'Send or Select'N'Send.
  • Page 30: Chapter 2: Parts Of A Script

    In the previous section you learned how to use ScriptWizard to create your first script. Now, let's examine the script created by ScriptWizard to learn how it works. Each script is written in LDDScript, a scripting language unique to Document Distributor. Objects Objects are the building blocks of LDD scripts.
  • Page 31 Example 1 accesses the EmailSMTP Action each time a property or method is called. Example 2 is the same script using the shortcut. Example 1 EmailSMTP.Server="mail.server.com" EmailSMTP.To="NewEmployee@lexmark.com" EmailSMTP.From="LDDTrain@lexmark.com" EmailSMTP.Subject="New Job Listings" EmailSMTP.Message="Please post on the following Monday." EmailSMTP.CharacterSet=LDD_SMTPCHARSET_US EmailSMTP.Attachments=original.document...
  • Page 32: Data Objects

    "name" are all considered the same variable name. • Cannot be a reserved word (one that has a special meaning to the script compiler). For a list of Reserved words, see the “Script Reference” located at Start Document Distributor Client. Valid Variable Declarations: string abc int try2...
  • Page 33 Boolean Data Type (bool) The boolean data type can store a value of TRUE or FALSE. This data type has no properties. There are several operations that can be performed with the bool data type. The examples below use the following two variables bool b1, b2 b1 = TRUE b2 = FALSE...
  • Page 34 Real Data Type (real) Real data type variables and properties contain numbers with decimal points. There are many mathematical and comparison operations that can be performed with real variables and properties. Symbols <, LT >, GT <=, LE >=, GE ==, EQ <>, !=, NE String Data Type (string)
  • Page 35 Document Data Type (doc) The document data type holds a collection of image, text, and other formatted files. A document may contain one or more files. Each file in a document has a label and a type. The label is the filename minus the extension;...
  • Page 36: Action Objects

    Action Objects Actions are objects that process documents in some way. Each Action has properties that control how the Action works. The Actions properties can be of the same data types as variables: bool, int, real, string, doc. Examples of properties: EmailSMTP.To (defines who to send the e-mail to) FTPget.Password (specifies the password to use when logging into the FTP server) ImageCrop.Left (specifies the left edge of the rectangle to crop)
  • Page 37: System Objects

    System Objects There are several types of system objects. The “original” system object contains the document that was received by the Document Server with the job in a property called "document." The document may be the original that was scanned at an MFP, or it may be a document that was received by way of a user's workstation from Select'N'Send or Print'N'Send.
  • Page 38 The original system object contains very important information and is used often in scripts. The first script you created in the ScriptWizard uses it twice. This statement sets the EmailSMTP property of Attachments to original.document. Now the EmailSMTP Action e-mails a copy of the original document scanned. This statement sets the ConvertToDocument property of input to original.document.
  • Page 39: Helper Objects

    Helper Objects There are two types of helper objects that can be used in your scripts: Arrays and TextFiles. Arrays Arrays are collections of strings. Arrays are returned by the string method Separate. The array of strings can only be read, you cannot write to the array to add strings to it. Here is an example of how an array is created.
  • Page 40 TextFiles The TextFile helper object manipulates files containing alphanumeric text. The TextFile helper object cannot be used to access images files, word processor files, or other types of files. The TextFile object can read from an existing text file or write text to a new file. These are the basic methods used to access a TextFile object.
  • Page 41 Example: Read the entire contents of a file called data.txt into a string variable. textfile tf string data int size tf.Open("c:\data.txt", FALSE) size = tf.GetSize() data = tf.Read(size) tf.Close() The string variable named data now contains the contents of the text file. See the “Script Reference”...
  • Page 42: Summary

    Summary A basic script first declares any variables that will be needed. Next Action objects are used to perform operations on documents. Variables are used to store data produced while the script is running. Many Actions have an input property that specifies what document it should operate on. Similarly most Actions have an output property.
  • Page 43: Chapter 3: Using The Script Editor

    Using the Script Editor ScriptWizard is a great way to start your scripts. ScriptWizard lets you choose the Actions you want in the script, declares the variables for you, and provides error checking on the settings you specify. But sometimes you need to add just one more Action or make some other change. With the Script Editor in Document Server Admin, it's easy to make changes to scripts you've created with ScriptWizard.
  • Page 44: Script Editor Toolbar

    Script Editor Toolbar There are many tools you can access from the toolbar above the Script Editor window. Icon Description Cut the selected text out of the script and place it on the clipboard. Paste text from the clipboard into the script editor Undo the last insertion into the script Search for a text string in the script.
  • Page 45: Adding An Action Using The Insert Actions Wizard

    Adding an Action Using the Insert Actions Wizard Lets start with a simple example script that was created with ScriptWizard. Example: doc FaxablePostScript with ConvertToDocument .input=original.document .Format=LDD_DOCFORMAT_PS .PaperSize=LDD_PAPERSIZE_AUTO .Orientation=LDD_ORIENTATION_AUTO .PSResolution=LDD_RESOLUTION_AUTO .AllPages=TRUE .Go() FaxablePostScript=.output endwith with FaxByPrinter .input=FaxablePostScript .IPAddress="faxout.server.com" .FaxNumber="99188812345678" .StationID="Mail Room" .WaitForCompletion=FALSE .Go() endwith...
  • Page 46 Lets add a SaveToFile Action that will store a copy of the order on the Document Server's hard drive. Decide where the new Action needs to go in your script. Remember, if another Action uses the output of your new Action, then the new Action must be added before that Action. For our example, lets add the SaveToFile Action at the end of the script.
  • Page 47 Click Add. Click Next to set the properties for this new Action Click the input property and select Use variable or property, and click original.document. You want to save the original scanned document, not the converted PostScript document. Click the Path property. Specify a location to save the file. This is a drive on the Document Server system.
  • Page 48 Click the AppendTimestamp property. Since you expect to receive more than one new order, you will need some way to distinguish between all the image files. Verify the setting is TRUE; this will append a timestamp to produce a unique file name for each new order received. Click Finish.
  • Page 49: Add Actions Manually

    Add Actions Manually You can also add Actions manually. The Script Editor has an auto-completion tool to make this easier. You can use the “with” syntax shortcut and take advantage of the auto-completion tool. To begin adding the new Action (for this example, we will use EmailNotes): Place your cursor in the script where you want to add the new Action.
  • Page 50 The auto-completion tool is also useful when adding a method. It presents a list of the parameters for the method, so you don't have to look them up in the “Script Reference.” For example, you want to use the Contains method for a string variable to determine whether this string contains the text "Confidential".
  • Page 51: Compilation Prompts

    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.
  • Page 52: Chapter 4: Flow Control

    Flow Control Statements in a script are executed in the order they are written in the script. Flow control statements let you change this flow and execute statements selectively and repetitively. You can insert an empty flow control statement into a script by clicking the Insert Logic button on the Script Editor toolbar. Flow control statements can be either Conditional or Repetitive.
  • Page 53 Example: If the original scanned document is less than 1 MB, e-mail a copy to the public relations department. Use the less than operator to check the size of the original document. if (original.document.GetDocumentSize() < 1000000) then with EmailNotes .To="Human Relations" .From=original.username .Subject="Important News"...
  • Page 54 MailMessage = "This email was sent by " + original.username + "." else MailMessage = "This email was automatically generated by LDD." endif with EmailSMTP .Server="mail.server.com" .To="JoeSmith@foobarcompany.com" .From="DocServer@lexmark.com" .Subject="New Document" .Message= MailMessage .CharacterSet=LDD_SMTPCHARSET_US .Attachments=original.document .Go() endwith Result Now the recipient of the e-mail will know which user submitted this job. For example, if an employee with an ID of JWilson sends the job from their workstation the e-mail message will be, "...
  • Page 55: Switch/Case

    However, if a default block is used, it must be the last block. Example of Switch Lexmark MFPs have a job accounting capability. When this feature is enabled, users must enter an account number before accessing a profile. For this example, users enter a department number when using profiles.
  • Page 56: Repetitive Statements

    Repetitive Statements Each statement in a script is executed only once. The repeat and loop statements let you execute the same block of statements multiple times. You can insert an empty repeat or loop statement by clicking the Insert Logic button on the Script Editor toolbar. Loop When you want to repeat a set of statements a known number of times, use the loop statement.
  • Page 57: Repeat

    // Open the results of the OCR Action tf.Open(ConvertToText.output) bool bConfDoc = FALSE int iCount, iEnd iCount =1 iEnd = tf.GetNumberLines() Submitter = original.username+ "@lexmark.com" // Check each line for the term Confidential repeat (until (bConfDoc OR (iCount>=iEnd))) OneLine = tf.ReadLine() if (OneLine.Contains("Confidential")) then...
  • Page 58: Summary

    // If it's a Confidential Document, save it and send warning message if (bConfDoc) then with SaveToFile .input=original.document .Path="c:\ebc.txt" .AppendTimestamp=TRUE .Overwrite=FALSE .SaveUserData=FALSE .Go() endwith with EmailSMTP .Server="mail.server.com" .To= Submitter .From="mailcheck@abcxyz.com" .Subject="Invalid Email Rejected" .Message="Cannot email a confidential document" .CharacterSet=LDD_SMTPCHARSET_US .Go() endwith else with EmailSMTP...
  • Page 59: Chapter 5: User Data

    User Data Sometimes you need more information from your users who submit jobs to the Document Server. For example: • What account should this job be billed to? • What is your department number? • What is the loan amount? The scripts you have written up to now don't have any way to communicate with the user.
  • Page 60 If the profile with user data is selected from an MFP, each question is presented individually. For an MFP without a touch screen, only questions with numeric answers should be used, as there is no way to enter alphabetic input. This dialog contains the questions provided in the script.
  • Page 61: Creating User Data In A Script

    Creating User Data in a Script When ScriptWizard starts, decide whether you want to ask your users any questions. Select Yes to define the questions you want to ask.
  • Page 62 The "Original and User Data" dialog appears. Click on Add for each question you want to ask your user.
  • Page 63: Types Of User Data

    Types of User Data After you click Add, the “Add/Edit Data Item” dialog appears. The Display Name is the question that is displayed to your user. The Variable Name is the name used to access the user’s answer in the script. The Data Type is the type of data you can gather from your user: •...
  • Page 64 Checkbox A checkbox data item is used when you have a yes/no or true/false type of question for your user. For example: • Is this work billable? • Keep a copy of this fax? • Print the document in color? The answer selected by the user is then used in your script as a Boolean variable.
  • Page 65 Integer Let’s your user enter a numeric value in response to a request for user data. For example: • What is the account number? • How many copies to print? • What is your department number? The answer given by the user can then be used in your script as an integer value. You can provide a default value as well as a minimum and maximum value.
  • Page 66 String Allows your user to enter a string of alphanumeric characters. Questions that are appropriate for a string value include: • What is your name? • Enter the e-mail address: • Enter your job title: The answer given by the user can be used in your script as a string value. You can provide a default value for the string.
  • Page 67: Combo Boxes

    Combo Boxes You can have either an integer combo box or a string combo box. These controls let your user choose among a fixed list of choices. When the list of choices is known, a combo box control prevents users from entering incorrect answers.
  • Page 68: Using User Data In A Script

    Using User Data in a Script Now that you've prompted your users for information, the Userdata object lets you use that information in your script. The Userdata object contains one property for each question that you prompted your user for. For example: In the example script on the next page, there are three user data items.
  • Page 69: Summary

    For more detailed script examples, see the “Script Examples” document. For more detailed information on objects, properties, and methods, see the “Script Reference”. Both of these documents are located at Start Distributor Client. Programs Lexmark Document...
  • Page 70 Lexmark and Lexmark with diamond design are trademarks of Lexmark International, Inc., registered in the United States and/or other countries. © 2002 Lexmark International, Inc. 740 West New Circle Road Lexington, Kentucky 40550 www.lexmark.com...

Table of Contents