Hi,
First of all, sorry for the late reply. So we understand what you are saying, but it does not match with the screenshot that you have shared with us before. What I understand that you want to select the object either group or file or may be simple rectangle by just it names. Because, you said <Path> is name of the file but you also mention it is just a normal layer. So it a bit of confusion here. If you just want to select any item with the name irrespective of where it exists in the document, either inside the group or inside the layer, this will work.
For selected "Mandala" group,
var docRef = app.activeDocument;
docRef.selection = null;
var _itemName = "Mandala"; // change name as per the requirement
try {
var _item = docRef.pageItems.getByName(_itemName);
_item.selected = true;
} catch (e) {
alert("No object with name - " + _itemName + " exists!")
}
For selecting item with name <Path>
var docRef = app.activeDocument;
docRef.selection = null;
var _itemName = "<Path>"; // Change name as per requirement
try {
var _item = docRef.pageItems.getByName(_itemName);
_item.selected = true;
} catch (e) {
alert("No object with name - " + _itemName + " exists!")
}
So, whatever you want to select just change _itemName value in the above script. Also, getByName will select only one object even if more objects with same exists in the document.
NOTE: Whenever you create the object/path in Illustrator, they don't have their names. For an example : You create the rectangle using rectangle tool, what you see inside the layers panel is as "<Rectangle>", but that is not its name. To name the object you need to double click and type the name as "<Rectangle" or something else, and use that name in the above script. So, make sure <Path> is the name of the object in your document.
Let us know if this resolves your query.