Sticky-note Getting the text

Started by FredFlintstone, March 08, 2025, 11:27:14 AM

Previous topic - Next topic

FredFlintstone

I'm looking for a solution to extract the text content from a Sticky-note. Do not seem to be a simple way or otherwise I'm just not able to figure it out :o.

blueprint=$(".Structure").first();
elements=$(blueprint).children();

elements.each(e => {
    console.log("> "+ e + "("+e.text+")");
    console.log("> "+ e + "("+e.content+")");
    console.log("> "+ e + "("+e.documentation+")");
});

All of the above beside documentation returns undefined, the later returns nothing, guess that is an empty string.

Is is so that there are no means to interface the sticky-note object within the current JArchi implementation?

Phil Beauvoir

#1
Assuming you mean a note on an ArchiMate View then note.text will get the text content.

https://github.com/archimatetool/archi-scripting-plugin/wiki/Visual-Objects#text

But I think you are not getting the children of the visual object on the View. You are probably getting the concept. You need to find the "Structure" object on the view.

text = $("view").children(".Structure").children("diagram-model-note").first().text;
If you value and use Archi, please consider making a donation.
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

FredFlintstone

Thanks Phil

Sorry for not being precise. It was on the the Sketch-view and with the sketch-model-sticky. Sorry about lack of that piece of crucial information :(