I construct a lot of Indesign Tagged Text files, and this is an example of what I stick at the beginning of the line when the style sits in a group. The style name is "AGBoldCtr" and it sits in group "xSports."
In code, I create a variable for a style in a group like this:
var PPHead = app.activeDocument.paragraphStyleGroups.item("xSports").paragraphStyles.item("AGPPHead");
Then I assign variable PPHead to a paragraph as in:
app.activeDocument.selection.paragraphs[iLoop].appliedParagraphStyle= PPHead; //
Thank you Mr. Conrad,
The code ended up like this and works perfect thanks to the code you supplied:
myStyle = app.activeDocument.paragraphStyleGroups.item("Headings").paragraphStyles.item("Heading 1"); myStyle.appliedFont = "Microsoft JhengHei";