You can use that script, drag and drop it into PM’s action list, and select
Set Properties. You can also create an object variable, and configure it to use that property (by navigating the menus to the script/component’s properties). Later on, you’ll need to use the Linker Wizard.
I found get/set properties a bit frail, so I recommend to write your own custom action that sets the property, or maybe port the entire script. There are some good resources on how to get started with simple custom scripts that pass in information, and you can also
request actions in the forum.
There might be also something in the forum, or on the Ecosystem, haven’t checked