Unable to change text in component

Hi there!

I am developing one plugin and in one of features I need to programmatically change the text in the artboard. Everything works fine with clean text element but it does not the case when text element is inside the component (symbol instance).

Let me first of all explain the flow from the very beginning. My plugin contain several buttons and by pressing on one of them (well actually this scenario appears in several places) the plugin generates new artboards (based on existing artboards which user have in document) and also text in those generated artboards should be changed.

And right now in case when text is in the component - I am getting an error that I am out of edit context and all my changes (including artboards generation) are revered in the end of function execution which I attached to button callback (obviously with editDocument method) wrapper.

And I went through the forum and found several threads which are related to limitations of the editContext. Well I also tried to split this flow and after new artboard are generated, I am completing the callback execution and showing kind of confirmation dialog with another button and after user will press the button in that dialog I am trying to change texts in artboards which I generated one moment before. And…still getting the same error that I am out of edit context :sob:

I found two suggestions in existing discussions on this forum like do ungroup and group on the fly (which did not work for me, the same error appears again) or changing text in the master symbol. And this is also no go to me because I only need to change this text in one particular instance.

Do you have any advices for me? Or ever working solution?)

Thanks!