You would have to have the source-code of the big software package in question ... and a helluva lot of time and energy ... to build a new macro processor into it. Only if the application is "otherwise externally controllable" could a different language e.g. Perl be used to control it. For example, if a Windows package fully supported OLE.