edit (@examples.testText);
editMenu.selectAll (); // prepare to save the present window contents
editMenu.copy (); // Now the present contents are saved.
wp.setText ("This is the new text for the window.")
» true
Notice that the former contents of the window are completely replaced with the string, "This is the new text for the window."
Now type and execute:
editMenu.selectAll ();
editMenu.paste ()
» true
The window's contents are restored.