Try this, it looks pretty generic to me:
http://xmacro.sf.net/
(It's not WM/DE specific.)
Linux distributions usually contain some powerful scripting tools, Perl for example. Simple tasks can be automated with Bash shell scripts with virtually no programming experience. KDE even allows running applications to be controlled via
DCOP commands. This makes recording mouse movements and key presses often unnecessary. Many applications have, ofcourse, their own macro features.
Regards
Simon