Сравнение версий

Ключ

  • Эта строка добавлена.
  • Эта строка удалена.
  • Изменено форматирование.

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

Image Added

Settings of parameters


Name

Description

TypeMandatory field

Parameters






ContextContext for working with a tabular document via ONLYOFFICE.Robin.OnlyOfficeCellYes
Macro Path

Path to the js file that contains the JS code for the macro

Acceptable file extension: .js

Robin.FilePathYes
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

  • The field does not need to be filled in if there are no input parameters in the macro
  • The field must be filled in if there are input parameters in the macro
  • There must be exactly as many elements in the collection as there are input parameters in the macro. Elements containing parameter values must be listed in the same order in which the corresponding 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

  • Since the types in Onlyoffice do not coincide with our types, for correct conversion of the macro result it is necessary to specify what type of data we expect to get
  • Field in the form of a dropdown list
  • Available list values:
    • String
    • Number
    • Collection
    • Table
    • Macro with no result
  • Default value - "Macro with no result"
  • If the result of the macro is a collection or a table, the action will return them as a collection of rows or a table with string values, respectively
  • The action will not terminate with an error if "Macro with no result" is selected and the action returns a result
Robin.StringNo

Results

ResultThe value returned by the running macro. If the macro returns nothing, the result will be emptyRobin.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 hereengОткрыть Редактор таблиц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. 

...