Give a look at this
Looking inside the kicad_pro I see instances of the pages, with the page_name close to it.
It could count 10 instances, where some are the same (5,6) and (7,8) since they are replicated.
This file could definitely have the files path relative to the root of the project, too.
Kicad page Instances (from board.kicad_pro)
1. 2324f0c0-e395-49b5-ab39-d3320ff8c95e|
2. 435ed840-ec43-460c-b7f0-792f0d0f9f20|Nested_Sheet_Level_1_Page_1_Instance_1
3. 45a427a9-bbe7-4bd2-a755-42e8f6c6539e|Nested_Sheet_Level_1_Page_1_Instance_2
4. 74388a62-f659-4e58-959d-93f2045e503b|Nested_Sheet_Level_1_Page_2
5. 4f0fa6fa-5b1e-42db-b778-210232f85f32|Nested_Level_2
6. 4f0fa6fa-5b1e-42db-b778-210232f85f32|Nested_Level_2
7. 55216734-bc5b-4eeb-8654-e5550adf0099|Nested_Level_3
8. 55216734-bc5b-4eeb-8654-e5550adf0099|Nested_Level_3
9. 129ccda7-700d-49a0-aac9-14c2a4ec2d62|Nested_Sheet_Level_1_Page_1_Instance_3
10. 4f0fa6fa-5b1e-42db-b778-210232f85f32|Nested_NEW_Level_2
Here it shows the existing .kicad_sch
files found with find
and they may not belong to the project. They may just be inside the project’s folder without being in use. So I cannot trust on this.
Existing Kicad schematics (using find)
1 ./board.kicad_sch
2 ./sch/nested_1.kicad_sch
3 ./sch/nested_2.kicad_sch
4 ./sch/nested_3.kicad_sch
5 ./sch/nested_4.kicad_sch
6 ./sch/nested_new/nested_1.kicad_sch
7 ./sch_new/nested_1.kicad_sch
8 ./sch_new/nested_3.kicad_sch
And then here, I have my recursive parser where I have to reconstruct a usable path from the root of the project. Line 2 and 4 show things inside the sch
folder, for instance, but the file_path found inside the schematics are not the same since they are based on the place where the current schematic sheet is.
Kicad schematic finder (uniq)
1 multipage-kicad-lheck | . | board.kicad_sch
2 multipage-kicad-lheck | . | ./sch/nested_1.kicad_sch
3 multipage-kicad-lheck | . | ./sch_new/nested_1.kicad_sch
4 sch | . | nested_4.kicad_sch
5 sch_new | ./sch_new | ./nested_3.kicad_sch
6 sch | . | ./sch/nested_1.kicad_sch
7 sch | ./sch | ./nested_3.kicad_sch
8 sch | ./sch | ./sch/nested_2.kicad_sch