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" );
var Styles = (app.activeDocument.allParagraphStyles);
var i = Styles.length;