1
Automation Interface, Add-Ins and Tools / Re: modifying selected text of Element.notes
« on: August 14, 2020, 06:44:29 pm »
Thanks for the replies.
My mistake for not making it clearer in OP
- Uffe's interpretation is/was correct - thanks for a confirmation of what I was afraid of :-)
Although the Repository.GetFieldFromFormat and Repository.GetFormatFromField are indeed interesting functions, afaik they will not help me in the screnario
Let's say I've got element notes like this:
"Example element note" -i.e. the note with a part of it bold
If I then call something like: Session.Output(Repository.GetFieldFromFormat("html",selectedElement.Notes));
I'll get
This could allow me (in conjunction with GetFormatFromField) for example find all bold parts of a note and add a font color to them
But what I want to do is to select/highlight part of the text and run a script, which would add pair tags around the selection - e.g. let's say i select/highlight "Example", I'd run a script and it the output would be
My mistake for not making it clearer in OP
- Uffe's interpretation is/was correct - thanks for a confirmation of what I was afraid of :-)
Although the Repository.GetFieldFromFormat and Repository.GetFormatFromField are indeed interesting functions, afaik they will not help me in the screnario
Let's say I've got element notes like this:
"Example element note" -i.e. the note with a part of it bold
If I then call something like: Session.Output(Repository.GetFieldFromFormat("html",selectedElement.Notes));
I'll get
Code: [Select]
Example [b]element [/b]noteThis could allow me (in conjunction with GetFormatFromField) for example find all bold parts of a note and add a font color to them
But what I want to do is to select/highlight part of the text and run a script, which would add pair tags around the selection - e.g. let's say i select/highlight "Example", I'd run a script and it the output would be
Code: [Select]
Example [b]{startOfTxtInsertedByScript}element {/endOfTxtInsertedByScript} [/b]note
. And if you know how to update a model based add-in more easily than by steps: save, Manage add-ins -> uncheck Load on startup, Manage add-ins -> check Load on startup, it would be even better