Add custom property to all assembly components using macro and Input Box

Hi All,

I am attempting to modify this macro Re: Add custom property to all assembly components using macro  from Ivana Kolin to get a work order number from a text input box then add a custom property Label1 to the assembly and all of the parts in a specific configuration. Right now the input box is popping up once for each part in the assembly how can I get it to pop up once and apply the work order number to the assembly and all of the parts in the assembly? I am new to Solidworks Is there a better/easier way to do this?

Thanks, Mike

Solidworks 2017

SolidworksApi macros