Send UNO command using postMessage

Hi there,

Is there any way to send a UNO command as a postMessage to the CODE iframe directly? I want to send a UNO command with arguments to the iframe and therefore, it is sent to the WSD server from there. Is it possible now? And if not, how can I execute UNO commands from the wrapper of the iframe?

Thanks

You can do this via python scripts if you like using a PostMessage:

https://sdk.collaboraonline.com/docs/postmessage_api.html#calling-python-scripts

You can do an Insert_Button with a specific UNO command (though we tend to filter these to ones that we support / make sense):

https://sdk.collaboraonline.com/docs/postmessage_api.html#id5

Quite probably we should add a new post-message to invoke a UNO command - like the Python thing, but simpler; what command do you want to invoke ? =)

I don’t really want to use Python macros. I wanted to use postMessages to directly execute UNO commands through sendUnoCommand method (with arguments), that’s why the UNO command inside button property is not going to answer my need.

I will contribute and add the postMessage to run any UNO command directly using postMessages, since it is easy to add, and in that way, I will contribute to the CODE to kind of give back to the community as well:)

I wanted to use uno:InsertBookmark UNO command to add bookmarks using postMessages.

Thanks for your response.

Thanks @pmzi for the PR Feature add Send_UNO_Command postMessage by pmzi · Pull Request #6099 · CollaboraOnline/online · GitHub

SDK documentation updated: Search — SDK https://sdk.collaboraonline.com/ documentation