For example, the following script creates an interactive sine wave graph. The script automates the interaction by sending messages to the frame box inside the window. Note the frame box assignment to tf in the middle of the script).
amplitude = 1;
freq = 1;
phase = 0;
freq = 1;
phase = 0;
amplitude = If(
tf << Reshow;