# [en] General

## [en] Open Label

[en] Open Label action specifies the label file that is going to be printed. When the action is executed, the label template opens in memory cache. The label remains in the cache for as long as the triggers or events use it.

[en] There is no limit on the number of labels that can be opened concurrently. If the label is already loaded and is requested again, NiceLabel Automation will first determine if a newer version is available and approved for printing, then open it.

[en] In this example, NiceLabel 10 loads the label label.nlbl from folder C:\ProjectA\Labels.

C:\ProjectA\Labels\label.nlbl

[en] If the specified label cannot be found, NiceLabel 10 tries to find it in alternative locations. For more information, see section Search Order for Requested Files in NiceLabel Designer user guide.

[en] Using Relative Paths

[en] NiceLabel 10 supports the use of relative paths for referencing your label file. Root folder is always the folder where the solution (or configuration in case the action is used in a NiceLabel Automation configuration) is stored.

[en] With the following syntax, the label loads relatively from the location of the configuration file. Automation Builder searches for the label in folder ProjectA, which is two levels above the current folder, and then in folder Labels.

..\..\ProjectA\Labels\label.nlbl

[en] Settings group selects the label file.

• [en] Label name: specifies the label name. It can be hard-coded, and the same label will print every time. The option Data source enables the file name to be dynamically defined. Select or add a variable that contains the path and/or file name if a trigger is executed or an event takes place.

### 提示

[en] Usually, the value to the variable is assigned by a filter.

### 注意

[en] Use UNC syntax for network resources.

## [en] Print Label

[en] This action executes label printing. It must always be nested within the Open Label action. Nesting allows it to obtain the reference to the label that is going to be printed. This further allows you to keep multiple labels open at the same time, and enables you to specify which label should be printed.

[en] After issuing this action, the label gets printed using the printer driver that is defined in the label template. If the defined printer driver is not found on the system, the label is printed using the system default printer driver. You can override the printer driver selection via Set Printer action.

[en] To achieve high performance label printing, NiceLabel 10 activates two settings by default:

• [en] Parallel processing. Multiple print processes are all carried out simultaneously. The number of background printing threads depends on the hardware; specifically on the processor type. Each processor core can accommodate a single printing thread. This default can be changed. For more information, see section Parallel Processing in NiceLabel Automation user guide.

• [en] Asynchronous mode. As soon as the trigger pre-processing completes and the instructions for the print engine are available, the printing thread takes it over in the background. The control is returned to the trigger so it can accept the next incoming data stream as soon as possible. If synchronous mode is enabled, the control is not returned to the trigger until the print process is finished. This can take a while, but the trigger benefits from providing feedback back to data-providing application. For more information, see the section Synchronous Mode in NiceLabel Automation user guide.

### 注意

[en] Using Save error to variable option in Action Execution and Error Handling does not yield any result in asynchronous mode, as the trigger does not receive feedback from the print process. To capture the feedback from the print process, enable synchronous mode first.

### 注意

[en] If the Print Label action is nested under a For Loop action, Automation executes it in session printing mode. This mode acts as a printing optimization mode that prints all labels in a loop using a single print job file. For details, see Session Printing section in NiceLabel Automation user guide.

[en] Quantity group defines the number of labels to be printed using the active form.

• [en] Labels: sets the number of printed labels. Data source specifies or adds a variable that defines the label print quantity dynamically.

### 注意

[en] Variable value is usually assigned by the Use Data Filteraction and must be integer.

[en] All (unlimited quantity): depending on the label template design, the labels are printed in various quantities.

[en] Unlimited Quantity Printing Details

[en] Typically, this option is used in two scenarios.

1. [en] Command the printer to continuously print the same label until it is switched off, or after it receives a command to clear its memory buffer.

### 警告

[en] This scenario requires NiceLabel printer driver to be installed and used for label printing.

[en] If printing a fixed label, just a single print job is sent to the printer, with the quantity set to "unlimited". Label printers have a print command parameter which indicates "unlimited" printing.

[en] If the label is not fixed, but includes objects that change during the printing, such as counters, the printed quantity is set to maximum quantity supported by the printer. NiceLabel printer driver is aware of the printer quantity limit and print as many labels as possible.

例 34. 示例

[en] Maximum supported print quantity is 32,000. This is the amount of labels that are print after selecting the All (unlimited quantity) option.

2. [en] The trigger doesn't provide any data, but only acts as a signal for "event has happened". The logic to acquire necessary data is included in the label. Usually, a connection to a database is configured on the label, and at every trigger the label must connect to the database, and acquire all records from the database. In this case, the All (unlimited quantity) option is understood as "print all records from the database".

• [en] Variable quantity (defined from label variable): specifies a label variable that defines the label quantity to be printed.

[en] The trigger doesn't receive the number of labels to be print, so it passes the decision to the label template. The label might contain a connection to a database, which provide the label quantity, or there is another source of quantity information. A single label variable must be defined as "variable quantity".

[en] Advanced group defines label printing details. Click Show advanced print options to define the Advanced print options:

[en] This section specifies non-frequently used label quantity related settings.

• [en] Number of skipped labels: specifies the number of labels that are skipped on the first page of labels. The sheet of labels might have been printed once already, but not entirely. You can re-use the same sheet by offsetting the starting position. This option is applicable, if you print labels to sheets of labels, not rolls of labels, so it's effective for office printers and not for label printers.

• [en] Identical label copies: specifies the number of label copies to be printed for each unique label. For fixed labels, this option produces the same result as the main Number of Labels option. For variable labels, such as labels using counters, you can get the real label copies.

• [en] Label sets: specifies how many times the entire label printing process should repeat.

例 35. 示例

[en] Trigger or event receive content with 3 lines of CSV-formatted data, so 3 labels are expected to be printed (1, 2, 3). If you set this option to 3, the printout is done in the following order: 1, 2, 3, 1, 2, 3, 1, 2, 3.

### [en] Product level info

[en] This functionality is available in LMS Enterprise and LMS Pro .

### 提示

[en] All Advanced group values can either be hard-coded, or dynamically provided by an existing or a newly added variable.

## [en] Run Oracle XML Command FileXML Transform

### [en] Product level info

[en] Automation Builder features require LMS Enterprise.

[en] This action executes printing with data obtained from an Oracle XML-formatted file.

[en] NiceLabel Automation internally supports XML files with "Oracle XML" structure, which are defined by Oracle Warehouse Management software.

[en] Use this action as a shortcut. It helps you execute Oracle XML files directly and without the need to parse them using XML filter and mapping the values to variables.

[en] To be able to use this action, the XML file must conform to Oracle XML specifications. For more information, see section Oracle XML Specifications in NiceLabel Automation user guide.

[en] File group defines the Oracle XML command file to be used.

• [en] File name: selected Oracle XML command file. It can either be hard-coded or dynamically defined using an existing or a newly created variable.

## [en] Run SAP AII XML Command File

### [en] Product level info

[en] Automation Builder features require NiceLabel LMS Enterprise or NiceLabel LMS Pro.

[en] This action executes printing with data from an SAP AII XML-formatted file.

[en] NiceLabel Automation internally supports XML files with the "SAP AII XML" structure, which are defined by SAP software.

[en] Use this action as a shortcut. it helps you execute SAP AII XML files directly without any need to parse them using XML filter and map values to variables. To be able to use this action, the XML file must conform to SAP AII XML specifications. For more information, see section SAP AII XML Specifications in NiceLabel Automation user guide.

[en] File group defines the SAP AII XML command file to be used.

• [en] File name: selected SAP AII XML command file. It can either be hard-coded or dynamically defined using an existing or a newly created variable.

[en] Optional Parameters group allows defining the label name in case it is not included in the XML file.

• [en] Label name: the selected label file that should be used in the command file. It can either be hard-coded or dynamically defined using an existing or a newly created variable.

## [en] Run Command File

[en] This action executes commands that are included in a selected command file. All File type options provide commands that NiceLabel 10 executes in top-to-bottom order.

[en] Command files usually provide data for a single label, but you can define files of any level of complexity. For more information, see section Command File Types.

[en] File group defines the type and name of the command file that is going to be executed (JOB, XML or CSV).

• [en] File type. Specifies the type of the command file to be executed.

• [en] File name. Specifies the command file name.

[en] File name can be hard-coded, and the same command file will execute every time. The option Variable enables a variable file name. Select or create a variable that contains the path and/or file name if a trigger is executed or an event takes place. Usually, the value to the variable is assigned by a filter.

## [en] Send Custom Commands

[en] This action executes the entered custom NiceLabel commands.

[en] Always nest this action under the Open Label action. This enables referencing the label to which the commands apply. For more information, see section Using Custom Commands in NiceLabel Automation user guide.

### 注意

[en] Majority of custom commands is available with individual actions, so in most cases, custom commands are not required.

### 注意

[en] Send Custom Commands action can be used to end the Session printing mode. This mode acts as a printing optimization mode that prints all labels in a loop using a single print job file. To end session printing, nest the Send Custom Commands action under the For Loop action and use the SESSIONEND command. For details, see sections Session Printing and Using Custom Commands in NiceLabel Automation user guide.

[en] Script editor offers the following features:

• [en] Insert data source: inserts an existing or newly created variable into the script.

• [en] Script editor: opens the editor which makes scripting easier and more efficient.