Hi Learner,
Please use the below JS code, its getting the paragraph styles only. If you need character styles also you can edit simply.
var Report = new File("~/Desktop/Styles_Report.txt" );
Report.open("w");
var Styles = (app.activeDocument.allParagraphStyles);
var i = Styles.length;while (i--){ Report.writeln(Styles[i].name+"\n") }
Report.close();
thx,
csm_phil