I want to have a palette that includes a button for defining subscripted variables as symbols. As this is only needed once per session, I also want the button to change colour when pressed. The code I am trying is attached. However, whilst it changes colour when pressed it does not change subscripted variables to symbols. Yet, if I use the Symbolize function on its own i.e. not in a button, it works. Is this a bug or am I doing something wrong?
subscripts = DynamicModule[{c},
subscripts = Dynamic@Button["\!\(\*SubscriptBox[\(x\), \(y\)]\)",
c = RGBColor[1, .1, .1];
Needs["Notation`"];
?Notation`Symbolize[NotationTemplateTag[Subscript[_, _]] ];
RunScheduledTask[
RemoveScheduledTask[$ScheduledTask], {0}, AbsoluteTime[] + 3],
Appearance -> {"DialogBox", "Palette"}, FrameMargins -> 0,
Background -> c, ImageSize -> 92, Method -> "Queued"],
Initialization :> {c = White}]