Macro to add parent assembly(ies) names to a custom property

I'll preface this by saying that I am very green to the Solidworks API, but do have some coding experience.

I am trying to come up with a macro that will find every assembly that a part or subassembly resides in and add the parent assembly name(s) to a custom property called "UsedOn". If the part or subassembly reside in multiple parents, all parent names must be added to the custom property separated by a single space. The macro can either be run on the top level assembly or individually on every file in a directory, that doesn't really matter to me. Can anyone offer up any suggestions?

SolidworksApi/macros