История страницы
Run external macro Version 1 (Python)
Action group: ONLYOFFICE
...
Description
The action launches a macro in the document, JS-code of which is specified in a separate file.
The ONLYOFFICE application must be installed to work with the action.
The action runs a macro specified in a separate .js file. The language in which the macro is written must be JavaScript.
Examples of macros - https://api.onlyoffice.com/plugin/macrosamples/
You can familiarize yourself with the operation of the ONLYOFFICE Table Editor application in the User Manual.
Action icon
Settings of parameters
Name | Description | Type | Mandatory field | |
---|---|---|---|---|
Parameters | Context | Context for working with a tabular document via ONLYOFFICE. | Robin.OnlyOfficeCell | Yes |
Macro Path | Path to the js file that contains the JS code for the macro Acceptable file extension: .js | Robin.FilePath | Yes | |
Parameters | Values for macro input parameters. Parameter values should be specified in the collection in the same order in which these parameters are listed in the macro code
| Robin.Collection | No | |
Result type | The type of data that the macro should return as a result of its operation. If the macro does not return a result, this field can be left blank
| Robin.String | No | |
Results | Result | The value returned by the running macro. If the macro returns nothing, the result will be empty | Robin.Object |
...
If we want to make changes to an open file, we must first run the "Run external macro" action, make changes to the file and run the engСохранить Редактор таблицSave (ONLYOFFICE) action.
Therefore, the example implementation will contain all 4 actions. The red dot is a breakpoint, i.e. the robot will enter the stop mode at the action we set it to. To continue, it will be necessary to click the "Start" button.
...
4. Set the parameters of the "Open" action by specifying the path to the file. You can see more details here: engОткрыть Редактор таблиц Open (ONLYOFFICE)
5. Set the parameters of the "Run external macro" action.
...
7. To do this, you must click on the engСохранить Редактор таблиц Save (ONLYOFFICE) action on the scheme, and fill in the Parameters field for this action.
...
4. Set the parameters of the "Open" action by specifying the path to the file. You can see more details here: engОткрыть Редактор таблицOpen (ONLYOFFICE)
5. Set the parameters of the "Run external macro" action.
...
7. To do this, you must click on the engСохранить Редактор таблиц Save (ONLYOFFICE) action on the scheme, and fill in the Parameters field for this action.
...