I want to move paragraph styles from paragraph style group to paragraph style pallete. I am using the below code to do that. Styles from style group is moved to out but showing inside of the style group. So every item of paragraph style is return without moved style name. It taken the last paragraph style as style group.
alert(app.activeDocument.paragraphStyles.length + " - " + app.activeDocument.paragraphStyles.everyItem().name)
for(var i = sGrp.length - 1; i >=0; i--)
cstyleGrp = sGrp[i];
for(var j = cstyleGrp.paragraphStyles.length - 1; j >= 0; j--)
var cstylGrpStyle = cstyleGrp.paragraphStyles[j];
cstylGrpStyle.move (LocationOptions.AT_END, app.activeDocument.paragraphStyles[app.activeDocument.paragraphStyles.length-1]);
//cstylGrpStyle.move (LocationOptions.AT_END, null);
//cstylGrpStyle.move (LocationOptions.AFTER, app.activeDocument.paragraphStyles);
if(cstyleGrp.paragraphStyleGroups.length > 0)
You can get very buggy behaviour if you're not careful with moving paragraph styles!
Anyway, the correct way to move a paragraph style is like this (you have to modify the code below so that p becomes a reference to a real paragraph style):
d = app.activeDocument;
p = /*some paragraph style in a para-style group*/
// The following line move paragraph style p out of its group and into the main list of paragraph styles in document d
Thank you... Its working...