I solved the underlying requirement in a different way.
But because others have voted here, I leave the request as unsolved.