A computer program product for performing dynamic scripting in a computer system with a memory, the computer program manipulating in the memory a document containing data objects, each data object including data and methods for changing the data, the computer program product comprising a computer usable medium having computer readable program code thereon, the program code including:
- program code for instantiating a plurality of selection objects, each of the plurality of selection objects including data defining an address space independent specification of at least one data object forming a selection from the document;
- program code for instantiating a plurality of command objects, each of the command objects including a data change command and a reference to a selection object on which the data change command applies;
- program code for storing a script consisting of a sequence of command objects in the memory;
- and
- program code for playing the script by sequentially calling a data change command in each of the sequence of command objects in the script, thereby executing selected data changing methods in the data objects specified by each referenced selection object.