Command Files

NOTE: The documentation here is provided for legacy support. It is recommended that new users use the XML Monitor.

Command files are files created by a user or separate application which can be processed by EASYLABEL. These contain a sequence of commands for common operations such as printing. An individual command file can be passed to EASYLABEL through the command line. EASYLABEL also supports monitoring command files.

Structure

Command files in EASYLABEL are separated into records. Each record consists of a verb followed by a series of clauses and ends with a semicolon “;”. Verbs and clauses are separated by whitespace such as a space or newline. Below is an example of the general format of a record:

verb
clause1
clause2
clause3;

A clause is a property followed by a series of arguments with an equals “=” character separating the property from the arguments and a comma “,” separating the arguments. There should be no whitespace between a comma and an argument. Below is an example of the general format of a clause:

property = arg1,arg2,arg3

Arguments may be enclosed by a pair of double quotes, single quotes, or parentheses. An argument enclosed by one of these pairs cannot contain the ending character of the pair. An argument must be enclosed by one of these pairs if one of the following is true:

  • The value begins with a double quote.

  • The value begins with a single quote.

  • The value begins with a opening parenthesis.

  • The value contains an equals symbol “=”.

  • The value contains white space such a space or newline.

  • The value contains non printable characters such as control codes or binary data.

Verbs

print

Creates a print job and adds it to the queue. This is the default verb used when a record contains no verb.

Clauses

  • formatname=name

    Sets the format to print.

    • Required: Once per command file.

    • Persists across records: Yes.

    • Initial value: None.

    • Order: Must be the first clause in the record.

    • Parameters:

      • name: The filename or fully qualified path to the format file without the “.fmt” extension.

  • formatcount=batchcount,batchsize

    Sets the number of labels to print.

    • Required: Yes.

    • Persists across records: No.

    • Initial value: None.

    • Order: Must appear after formatname clause. Must appear before the testprint or fieldname clauses.

    • Parameters:

      • batchcount: The number of batches to print. For databases “$ALL” or “ALL” can be used to print all batches in the database.

      • batchsize: The number of identical labels in each batch. Optional, defaults to 1 if not specified. Is ignored when the format contains no changing data.

  • testprint=enabled

    Enables or disables test printing.

    • Required: No.

    • Persists across records: Yes.

    • Initial value: off.

    • Order: Must appear after formatname and formatcount clauses.

    • Parameters:

      • enabled: Value must be either “on” or “off”. If on then a test print is performed instead of a regular print.

  • fieldname=value

    Sets the value of a variable field. Where fieldname is the name of the field in the format to set.

    • Required: No.

    • Persists across records: No.

    • Initial value: “”.

    • Order: Must appear after formatname and formatcount clauses.

    • Parameters:

      • value: The value of the field. Values longer than the field length are truncated to fit. Values shorter than the field length are padded with blanks.

  • useprinter=printer

    This clause is carried forward for legacy applications. The printername clause should be used instead.

    Sets which printer the job should be sent to.

    • Required: No.

    • Persists across records: No.

    • Initial value: None.

    • Order: Must appear after formatname clause.

    • Parameters:

      • printer: The index of the printer to print to. The index numbers are not constant and may change.

  • printername=name

    Sets which printer the job should be sent to.

    • Required: No.

    • Persists across records: No.

    • Initial value: None.

    • Order: Must appear after formatname clause.

    • Parameters:

      • name: The name of the printer to print to.

  • displaymsg=message

    Sets a message to be displayed before the job begins printing. The job will remain paused until the message is closed.

    • Required: No.

    • Persists across records: No.

    • Initial value: None.

    • Order: Must appear after formatname clause.

    • Parameters:

      • message: The message to display.

  • jobdescription=description

    Sets the description of the job. The description can be used for job identification and will be displayed in the queue.

    • Required: No.

    • Persists across records: No.

    • Initial value: “”.

    • Order: Must appear after formatname clause.

    • Parameters:

      • description: The description to use.

  • singlejob=enabled

    Enabling this causes jobs to be printed one at a time. If set to on EASYLABEL will not queue the job or process remaining records until the job from the previous print record is complete.

    • Required: No.

    • Persists across records: Yes.

    • Initial value: off.

    • Order: Must appear after formatname clause.

    • Parameters:

      • enabled: Use on to enable and off to disable.

  • where=(condition)

    Sets the condition to use for database fields. Only database records that evaluate to true are printed.

    • Required: No.

    • Persists across records: No.

    • Initial value: None.

    • Order: Must appear after formatname clause.

    • Parameters:

      • condition: The database condition.

  • orderby=fieldname

    Sets the order that database records are printed.

    • Required: No.

    • Persists across records: No.

    • Initial value: None.

    • Order: Must appear after formatname clause.

    • Parameters:

      • fieldname: The name of the field in the database.

  • outputfile=filename

    Sets the name or path to the file to be printed to. Printer instructions are sent to this file instead of a printer.

    • Required: No.

    • Persists across records: No.

    • Initial value: None.

    • Order: Must not be used in the same record as useprinter or printername.

    • Parameters:

      • filename: The file to print to.

eraserecords

Erases all the records in a dBASE (*.DBF) database file.

Clauses

  • dbase=databasefile

    Sets the database file to erase from.

    • Required: Yes.

    • Persists across records: No.

    • Initial value: None.

    • Order: Any.

    • Parameters:

      • databasefile: The database to erase from.

append

Appends the contents of a text file to a dBASE (*.dbf) file.

Clauses

  • dbase=databasefile

    Sets the database to append to.

    • Required: Yes.

    • Persists across records: No.

    • Initial value: None.

    • Order: Any.

    • Parameters:

      • databasefile: The database to append to.

  • inputfile=textfile

    Sets the file to copy from.

    • Required: Yes.

    • Persists across records: No.

    • Initial value: None.

    • Order: Any.

    • Parameters:

      • textfile: The file to copy from.

sort

Sorts the contents of a dBASE (*.dbf) file.

Clauses

  • dbase=databasefile

    Sets the database to sort.

    • Required: Yes.

    • Persists across records: No.

    • Initial value: None.

    • Order: Any.

    • Parameters:

      • databasefile: The database to sort.

  • orderby=order

    Sets the the database fields to sort by.

    • Required: Yes.

    • Persists across records: No.

    • Initial value: None.

    • Order: Any.

    • Parameters:

      • order: The database fields to sort by.

cancel

Cancels jobs in the queue. Either a single job or all jobs for a printer can be canceled.

Clauses

  • job=number

    Sets the job to be canceled.

    • Required: One of the clauses for this verb must be used.

    • Persists across records: No.

    • Initial value: None.

    • Order: Must be the only clause in the record.

    • Parameters:

      • number: The job to be canceled.

  • printername=name

    Sets the printer whose jobs should be canceled.

    • Required: One of the clauses for this verb must be used.

    • Persists across records: No.

    • Initial value: None.

    • Order: Must be the only clause in the record.

    • Parameters:

      • name: The name of the printer whose jobs should be canceled.

  • useprinter=index

    This clause is carried forward for legacy applications. The printername clause should be used instead.

    Sets the printer whose jobs should be canceled.

    • Required: One of the clauses for this verb must be used.

    • Persists across records: No.

    • Initial value: None.

    • Order: Must be the only clause in the record.

    • Parameters:

      • index: The index of the printer whose jobs should be canceled. The index numbers are not constant and may change.

getstatus

Gets the current printing status of a printer. Status is written to a file named n.dat where n represents the printer number. If the printer number is greater than 9 then a through z is used instead. For example ‘a’ is 10 and ‘b’ is 11.

If the getstatus is used before a print record then the file will be written to the EASYLABEL executable directory. If it is executed after then it will be written to the same directory as the last format that was printed.

This command is not supported with all printers.

Clauses

  • printername=name

    Sets the name of the printer to get status for.

    • Required: One of the clauses for this verb must be used.

    • Persists across records: No.

    • Initial value: None.

    • Order: Must be the only clause in the record.

    • Parameters:

      • name: The name of the printer to get status for.

  • useprinter=index

    This clause is carried forward for legacy applications. The printername clause should be used instead.

    Sets the name of the printer to get status for.

    • Required: One of the clauses for this verb must be used.

    • Persists across records: No.

    • Initial value: None.

    • Order: Must be the only clause in the record.

    • Parameters:

      • index: The index of the printer to get status for. The index numbers are not constant and may change.

clear

Clears the label format form the printers print buffer. This command is not supported with all printers.

Clauses

  • printername=name

    Sets the printer whose buffer should be cleared.

    • Required: One of the clauses for this verb must be used.

    • Persists across records: No.

    • Initial value: None.

    • Order: Must be the only clause in the record.

    • Parameters:

      • name: The name of the printer whose buffer should be cleared.

  • useprinter=index

    This clause is carried forward for legacy applications. The printername clause should be used instead.

    Sets the printer whose buffer should be cleared.

    • Required: One of the clauses for this verb must be used.

    • Persists across records: No.

    • Initial value: None.

    • Order: Must be the only clause in the record.

    • Parameters:

      • index: The index of the printer whose buffer should be cleared. The index numbers are not constant and may change.

close

Ends command file processing and exits EASYLABEL.

Clauses

This verb has no clauses.

Example

The following example creates two print jobs. The first will print one label from the format. The field named input will have the text “first record” and EASYLABEL will determine the printer to send the labels to. The second job will print two labels from the same format. The text for the input field will be “second record” and the labels will be sent the the printer named H427+. After the labels are printed the close verb will cause EASYLABEL to exit.

print
  formatname="c:\path\to\file"
  formatcount=1
  input="first record";

print
  formatcount=2
  input="second record"
  printername="H427+";

close;

Monitoring

EASYLABEL can be configured to monitor a command file for changes. When command file monitoring is enabled the software will check the file every .25 seconds and will automatically open and process it if modified.

Command file monitoring can be enabled in the program options or from the command line. EASYLABEL must then be placed in command file monitoring mode to be able to process the command file. To enter command file monitoring mode minimize the application when it is on the home screen. Maximizing the application will not exit command file monitoring mode. Click the close button in the ribbon or file menu to exit command monitoring mode. Enabling command file monitoring from the command line will cause EASYLABEL to immediately enter command file monitoring mode when it is started and will start minimized unless the display option is set.

Command file monitoring mode supports drag and drop functionality. Command files dropped onto the EASYLABEL window while in command file monitoring mode will be queued and processed in the order they were added.