[en] NiceLabel commands are used in command files to control label printing. NiceLabel Automation executes the commands within command files in top-to-bottom order. For more details, see section Command Files Specifications.
[en] You can use specific custom commands if they are available in your NiceLabel Automation product in form of an action.
[en] NiceLabel Commands Specification
[en] COMMENT
;
[en] When developing a command file, it is good practice to document your commands. This helps you decode what the script really does when you look at the code after some time. Use semicolon (;
) at the beginning of the line. Everything following the semicolon is treated as comment and does not get processed.
[en] CLEARVARIABLEVALUES
[en] CLEARVARIABLEVALUES
[en] This command resets variable values to their default values.
[en] CREATEFILE
[en] CREATEFILE <file name> [, <contents>]
[en] This command creates a text file. Use the text file to give signal to a third party application that the print process has begun or ended, depending on the location where you put the command. Use UNC syntax for network resources. For more information, see section Access to Network Shared Resources.
[en] DELETEFILE
[en] DELETEFILE <file name>
[en] Deletes the specified file. Use UNC syntax for network resources. For more information, see section Access to Network Shared Resources.
[en] EXPORTLABEL
[en] EXPORTLABEL ExportFileName [, ExportVariant]
[en] This command automates the "Export to printer" command that is available in label designer. The label is exported directly to the printer and stored in printer memory for off-line printing. The user recalls the label using printer keyboard or by sending a command file to the printer. The same functionality is available also with Store label to printer action.
注意
[en] To specify the label for exporting, use the LABEL command first.
-
[en] ExportFileName: This mandatory parameter defines the file name of generated printer commands.
-
[en] ExportVariant: Some printers support multiple export variants. When exporting manually, the user can select the export variant in the dialog. With the EXPORTLABEL command, you have to specify which export variant you want to use. The variants are visible in the label designer after you enable the Store/Recall printing mode.
[en] The first variant in the list has value 0. The second variant has value 1, etc.
[en] If you do not specify any variant type, value 0 is used as default.
[en] For more information about off-line printing, see section Using Store/Recall Printing Mode.
[en] IGNOREERROR
[en] IGNOREERROR <on> [,<off>]
[en] This command specifies that the error occurring in the JOB file does not terminate the printing process if the following errors occur:
-
[en] Incorrect variable name is used.
-
[en] Incorrect value is sent to the variable.
-
[en] Label does not exist / is not accessible.
-
[en] Printer does not exist / is not accessible.
[en] LABEL
[en] LABEL <label name> [,<printer_name>]
[en] This command opens the label to be printed. If the label is already loaded, it does not get re-opened. You can include the path name. Enclose the label name in double quotes if the name or path contains spaces. Use UNC syntax for network resources. For more information, see section Access to Network Shared Resources.
[en] The optional printer_name
specifies the printer, for which the label is opened. Use this setting if you want to override the printer name that is saved in the label template. If the driver for the provided printer name is not installed or not available, the command raises an error.
[en] MESSAGEBOX
[en] MESSAGEBOX <message> [,<caption>]
[en] This command logs the custom message
into the trigger log. If the message contains space characters or commas, enclose the text in double quotes ("
).
[en] PORT
[en] PORT <file name> [, APPEND]
[en] This command overrides port as defined in the printer driver and redirects printing to a file. If file path or file name contain spaces, enclose the value in double quotes ("
). Use UNC syntax for network resources. For more information, see section Access to Network Shared Resources.
[en] The APPEND
parameter is optional. By default, the file gets overwritten. Use this parameter to append data into the existing file.
[en] Once you use the PORT command in JOB file, it remains valid until the next PORT command, or until the end of file (whichever comes first). If you use PRINTER command after the PORT command has been executed, the PORT setting overwrites the port defined for the selected printer. If you want to use the actual port that is defined for the selected printer, you have to use another PORT command with empty value, such as PORT = ""
.
[en] PRINT
[en] PRINT <quantity> [,<skip> [,<identical label copies> [,number of label sets]]]
[en] This command starts the printing process.
-
[en] Quantity: Specifies the number of printed labels.
-
[en] <number>: The specified number of labels gets printed.
-
[en] VARIABLE: Specifies that a label variable is defined as variable quantity and that it contains the number of labels to be printed. The label determines how many labels get printed.
-
[en] UNLIMITED: If you use a database to acquire values for objects, unlimited printing prints as many labels as there are records in the database. If you do not use a database, the maximum number of labels that thermal printer internally supports gets printed.
-
-
[en] Skip: Specifies the number of labels you want to skip on the first page. The parameter is used for printing labels on sheets of paper. If the part of the page has already been used, reuse the same sheet by shifting the starting location of the first label.
-
[en] I dentical label copies: Specifies how many copies of the same label must be printed.
-
[en] Number of label sets. Specifies the number of times the whole printing process should repeat itself.
注意
[en] Make sure the quantity values are provided as numeric value, not as a string value. Do not enclose the value in double quotes.
[en] PRINTER
[en] PRINTER <printer name>
[en] This command overrides the printer as defined in the label file. If the printer name contains space characters, enclose it in double quotes ("
).
[en] Use the printer name as displayed in the status line of label design application. Printer names usually match the listed names under Printers and Faxes in Control Panel, but not always. If using network printers, you might see the name displayed in syntax \\server\share
.
[en] PRINTJOBNAME
[en] PRINTJOBNAME
[en] This command specifies the print job name as displayed in Windows Spooler. If the name contains space characters or commas, enclose the value in double quotes ("
).
[en] SESSIONEND
[en] SESSIONEND
[en] This command closes print stream. Also see SESSIONSTART.
注意
[en] SESSIONEND
must be sent as the only item in Send Custom Command action. If you want to send additional commands, use separate Send Custom Command actions.
[en] SESSIONPRINT
[en] SESSIONPRINT <quantity> [,<skip>]
[en] This command prints the currently referenced label and adds it into the currently open session-print stream. You can use multiple SESSIONPRINT commands one after another and join the referenced labels in a single print stream. The stream does not close until you close it using SESSIONEND command. The meaning of quantity and skip parameters is the same as with NiceCommand PRINT. Also see SESSIONSTART command.
-
[en] Quantity: Specifies the number of labels to be printed.
-
[en] Skip: Specifies the number of labels you want to skip on the first page. The parameter is used for printing labels on sheets of paper. If the part of the page has already been used, you can reuse the same sheet by shifting the start location of the first label.
[en] SESSIONSTART
[en] SESSIONSTART
[en] This command initiates the session-print type of printing.
[en] The three session-print-related commands ( SESSIONSTART, SESSIONPRINT, SESSIONEND) are used together. When you use command PRINT, data for each label is sent to the printer in a separate print job. If you want to join label data for multiple labels into a print stream, use the session print commands. To do so, start with the SESSIONSTART command, followed by any number of SESSIONPRINT commands. The sequence ends with SESSIONEND command.
[en] Use these commands to optimize label printing process. Printing of labels that belong to a single print job is much faster than printing labels using multiple print jobs.
[en] Use the rules below to make sure the session print does not break:
-
[en] You cannot change the label within a session.
-
[en] You cannot change the printer within a session.
-
[en] You must set values for all variables from the label within a session, even if some of the variables have empty values.
[en] SET
[en] SET <name>=<value> [,<step> [,<number or repetitions>]]
[en] This command assigns the variable name
with value
. The variable must be defined on the label, or an error is raised. If the variable isn't on the label, an error occurs. Step
and number of repetitions
are parameters for counter variables. These parameters specify the counter increment value and the number printed labels before the counter changes value.
[en] If a value contains spaces or comma characters, enclose the text in double quotes ("
). Also see TEXTQUALIFIER.
[en] If you want to assign a multi-line value, use \r\n
to encode a newline character. \r
is replaced with CR (Carriage Return) and \n
is replaced with LF (Line Feed).
[en] Be careful when setting values to variables that provide data for pictures on the label, as backslash characters might be replaced with other characters.
例 94. 示例
[en] If you assign a value "c:\My Pictures\raw.jpg" to the variable, the "\r" is replaced with CR character.
[en] SETPRINTPARAM
[en] SETPRINTPARAM <paramname> = <value>
[en] This command allows you to fine-tune the printer settings just before printing. The supported parameter for printer settings ( paramname
) are:
-
[en] PAPERBIN: Specifies the tray that contains label media. If the printer is equipped with more than one paper / label tray, you can control which one is used for printing. The name of the tray should be acquired from the printer driver.
-
[en] PRINTSPEED: Specifies the printing speed. The acceptable values vary from one printer to the other. See printer's manuals for exact range of values.
-
[en] PRINTDARKNESS: Specifies the printing darkness / contrast. The acceptable values vary from one printer to another. See printer manuals for exact range of values.
-
[en] PRINTOFFSETX: Specifies the left offset for all printing objects. The value for parameter must be numeric, positive or negative, in dots.
-
[en] PRINTOFFSETY: Specifies the top offset for all printing objects. The value for parameter must be numeric, positive or negative, in dots.
-
[en] PRINTERSETTINGS: Specifies the custom printer settings to be applied to the print job. The parameter requires the entire DEVMODE for the target printer, provided in a Base64-encoded string. The DEVMODE contains all parameters from the printer driver at once (speed, darkness, offsets and other). For more information, see section Understanding printer settings and DEVMODE.
注意
[en] The Base64-encoded string must be provided inside double quotes (").
[en] TEXTQUALIFIER
[en] TEXTQUALIFIER <character>
[en] Text-qualifier is the character that embeds data value that is assigned to a variable. Whenever a data value includes space characters, it must be included with text-qualifiers. The default text qualifier is a double quote character ("
). Because double quote character is used as shortcut for inch unit of measure, it is sometimes difficult to pass the data with inch marks in the JOB files. You can use two double quotes to encode one double quote, or use TEXTQUALIFIER.
[en] Example
[en] TEXTQUALIFIER %
[en] SET Variable = %EPAK 12"X10 7/32"%