Interface IApplication
This object provides access from script methods to the application. All scripts (the global script, the Job level script and the Index Class level script) have a global variable defined with name Application which is an object of this type.
Methods list
Remarks
alias Application
Methods
dialog(content, title, closable)
Creates a modal Dialog with the given custom content.
Declaration
dialog(content: HTMLElement, title: string, closable: boolean): IDialog;
Parameters
| Type | Name | Description |
|---|---|---|
| HTMLElement | content | |
| string | title | |
| boolean | closable |
Returns
| Type | Description |
|---|---|
| IDialog |
getCurrentLanguageTag()
This method returns the IETF BCP 47 tag of the language that is currently being used.
IETF BCP 47 tag of the currently selected language
Declaration
getCurrentLanguageTag(): string;
Returns
| Type | Description |
|---|---|
| string |
getCurrentScanProfile()
Retrieves the currently selected scan profile.
Declaration
getCurrentScanProfile(): IScanProfile | undefined;
Returns
| Type | Description |
|---|---|
| IScanProfile | undefined | IScanProfile the current scan profile if any selected or undefined if none is selected |
getScanners(serviceType)
Provides a list of the scanners available to the running workstation. Note that an available scanner might be disconnected and not available for use. The name of the scanner matches the name that is shown to Scanner related dialogs.
Declaration
getScanners(serviceType: ScanService): Promise<IScanner[]>;
Parameters
| Type | Name | Description |
|---|---|---|
| ScanService | serviceType |
Returns
| Type | Description |
|---|---|
| Promise<IScanner[]> |
performContextAction(actionType, properties, targetNode, selection)
This method can be used to invoke programmatically several actions in the application.
You should not use this method when you know that other actions are pending. For example, when an existing Batch is closed because the user pressed the New Batch button, then a action is followed by a action. In that case, when you receive the batchUnloaded event, you should avoid using this method because your Action will be performed after the action.
In general, the implementer must provide the Action type and a list of INode upon which the Action will be performed. Different Actions may impose different restrictions on the selectedNodes list. For example, some Actions may require that all INode are Pages. If the requirements are not met, the Action will not be performed.
Some Actions may require additional properties in order to be performed. These are passed as a Map with the actionProperties argument. For example, Action requires a "rotation_angle" property.
Some Actions may require an "action node" to be defined. This is passed with the actionNode argument. A possible example is a Paste Action which needs a list of selectedNodes to be copied and an actionNode where the Nodes will be copied into.
All actions are defined by . However, there are certain actions that cannot be invoked programmatically.
Please, check the documentation of for more details on how each Action works and what the corresponding arguments in this function should be.
Declaration
performContextAction(actionType: string, properties: any, targetNode: INode, selection: INode[]): any;
Parameters
| Type | Name | Description |
|---|---|---|
| string | actionType | |
| any | properties | |
| INode | targetNode | |
| INode[] | selection |
Returns
| Type | Description |
|---|---|
| any |