Hi
not very elegant this, but I tested and it seems to work
if you add another action to your write trigger, as the last action in that trigger: write to file text: #all_active#
the text file will have a jumble of selection names and multiple #all_active#, but there will always be a #all_active# at the end of the file.
the import process works correctly and the selections are imported, it's just the file looks a mess