How to select all the sketches in one go

I have to make a journal which works like when I give it a run,
it automatically detects all the sketches and planes in the part navigator and asks to which layer these components should be moved in.

Like if you want to move all sketches in layer 10, then you have to write 10 in the program interface.
Similarly if you want to move all planes in some other layer (in same program) it can be done in one go.

Each part has various "collections" of objects; all the sketches are contained in the ".Sketches" collection. The code in the link below shows how to get all the sketches from the collection and change their layer.