As KiCad does not have an API with which you could achieve this, one of the avenues to explore is GUI automation. Python code.
As KiCad does not have an API with which you could achieve this, one of the avenues to explore is GUI automation. Python code.