I know FrontEnd`SelectionSetStyle
is undocumented, but its name suggests it does what I need. What is its syntax?
I have already tried several variations of the following button on some selected code in an input cell.
Button["set",
FrontEnd`SelectionSetStyle[FontColor, RGBColor[{1, 0, 0}]];
Print[CurrentValue["SelectionData"]]]
Update
Using the kernel, the following code does what I need:
Button["set",
SetOptions[NotebookSelection[InputNotebook[]], FontColor -> RGBColor[{0, .7, .5}]];
Print[CurrentValue["SelectionData"]]]
I assume that FrontEnd`SelectionSetStyle
can change the font color of the selection while using the front end only. If so, what is its syntax?