Hello,
you can call that script from background view if you define it in options>mechical design>drafting>layout>background view>fill in path were you're script is located
*restart catia to implement the changes*
You now can go to background and call you're script via the icon on the right...