Abstract The AIDE project intends to provide developers with a system substrate for application-independent Programming By Demonstration (PBD). The AIDEWORKBENCH allows a developer to add advanced macro capabilities to his Smalltalk-based application (whatever it is) without re-implementing everything from scratch. We first introduce the workbench by describing its general architecture and its main components: high-level events, macros, and an "intelligent" event manager. Then we present SPII, a general purpose graphical editor supporting PBD, which has been implemented using the workbench. A major problem arising in the domain of PBD is how to express users' intentions. Some features of the workbench, particularly well suited to deal with this problem, are also discussed.