Macro to copy & paste custom properties

Hello all.

I was wondering if anyone could please help me with this:

Would you be able to make me a macro that copies the value from the bends for sheet <1> cutlist properties.

And pastes it in the bends value within the custom property list (replacing 'n/a' as shown in my attached images.

Or let me know if there is an easier way to set up a template that takes the bend information from sheet 1 in the the custom property.

If this is possible, is there a way to trigger a macro from a certain command. i.e it will run every time the 'sheet metal base flange/tab' function is used?

Many thanks.

SolidworksApi macros