Execute Visual Editor commands programatically from RStudio via API

How can I programmatically execute Visual Editor commands in RStudio Visual Editor mode?
In particular, I need to add/change/remove headers (the shortcuts do not work as I configured them to apply adding functions in Source Editor mode):

image

I need something like

rstudioapi::executeCommand("commentUncomment")

But the required command is not listed in Administration Guide - RStudio IDE Commands

I'd like to access the other commands like changing format (bold, italic, verbatim, normal), inserting figures or references, etc.

Similar question without answers.

How can I do that?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.