Very Simple
Step 1
Copy This Whole Code And Save File As AutoSelectLayer.jsx or Whatever You Like; (USE .js Extension If .jsx Doesnt Work For You)
Furthermore; Save that script to your illustrator script folder and Restart Your Illustrator.now Open Your .ai File And select any one layer. Go to File-Scripts-scriptName.jsx
and Click on It ; If Your Parent Layer Selected then congrats! You Can Move On Step 2.
#target illustrator
var doc = app.activeDocument;
var curLayer = doc.activeLayer;
curLayer.hasSelectedArtwork = true;
Step 2
Go To Action Panel ( If Not Available Then Go To Windows-Actions
)
Create New Action And Once It Starts Recording
Create New Action But Don't Forget To Assign Function Key To F2
Once That Red Record Button Gets Red Go To The three small lines Menu As Shown In Image And Click On it
Click On Add Menu Item...
Click On File-Script-ScriptName.jsx
And Press Ok; Now It Should Be Like Below Now Your Action Should Contain Your Script Name; If This Happen Stop Recording Of Action And All Set
Now Whenever You Want To Select Parent Layer Just Select Layer And Press F2
As We Set In Step 2. and Script will auto select all child objects
Tested it in illustrator 2015; It might go wrong on CS6; If I Did Any mistake Kindly Help to make this answer even Better
- Regards; Phoenix Design