I use Mathematica 9.0.1 and I want change the color of a selection in a text cell using a button. But when I use this code it changes the color of the entire cell.
Row[Button[Graphics[{#, Rectangle[]}, ImageSize -> 20],
SetOptions[NotebookSelection[InputNotebook[]], FontColor -> #], Appearance -> None] & /@
{ColorData["HTML"]["RoyalBlue"], ColorData["HTML"]["OliveDrab"],
RGBColor[0.419608, 0, 0.733333], Black}]
What do I do wrong? It used to work in Mathematica 8 and 9.0.0. I want it to work exactly like the Text Color command in the Writing Assistant palette (or the Format >> Text Color menu command).