Run a Macro Automatically

CATIA V5 3Dexperience 

Hello to the entire community.
Is it possible to automatically run a macro just before generating an aptsource? Or more precisely, can we specify a macro to run in the pptable?
In Catia V5 and 3D Experience
Thanks in advance for your feedback!