I would like to get to contents of text that is applied with a specific paragraph style, so that I can copy it to another text frame
app.findTextPreferences = app.changeTextPreferences = null; app.findTextPreferences.appliedParagraphStyle = "headline"; // and then get the value/contents of that applied paragraph style
Something like this:
str = "";
found = app.activeDocument.findText();
for (i = 0; i < found.length; i++)
str += found[i].contents;
"str" now contains aal text styled with that paragraph, which you can now save in a text file.