Multi-core scripting

Our ASIC has 4 independent M7 cores (it's not a quad core configuration). In DS-5, we created one Debug Configuration per core to download the correct fw image to each core.

We would like to write a (single) script that can send commands to each of the 4 cores, however the Scripts window is "Linked" to the core selected in the "Debug Control" window, so the script can only send commands to the selected core.

How can a script control cores of different Debug Configurations?

Thank you!