-
1. Re: How to show/say top level group/directory
pkahrel Aug 23, 2013 1:02 AM (in response to Asher31)I'm not sure if this is the answer you were looking for: if a style's parent is a document, it's a top-level style:
if (myStyle.parent instanceof Document) {
// myStyle is not in a style group
}
Peter
-
2. Re: How to show/say top level group/directory
Asher31 Aug 23, 2013 1:08 AM (in response to pkahrel)Where abouts would i put that, and what do i put in the "group" instead of the name of the group, or do i just leave it blank?
And thanks heaps for taking to time to answer,
Cheers
-
3. Re: How to show/say top level group/directory
Jump_Over Aug 23, 2013 1:11 AM (in response to Asher31)Hi,
Modify a function:
function replaceStyle(GroupOld , find, GroupNew, replace){ try{ var myDoc = app.activeDocument, importedStyle = myDoc.paragraphStyles.item(find), ApplyStyle = myDoc.paragraphStyles.item(replace); if (GroupOld) importedStyle = myDoc.paragraphStyleGroups.item(GroupOld).paragraphStyles.item(find) ; if (GroupNew) ApplyStyle = myDoc.paragraphStyleGroups.item(GroupNew).paragraphStyles.item(replace) ; importedStyle.remove(ApplyStyle); } catch(e){ //alert (e) } }you can call it like:
replaceStyle("", find, "", replace) or
replaceStyle(0, find, 0, replace) or
replaceStyle(undefined, find, undefined, replace)
for top-level styles
Jarek
-
4. Re: How to show/say top level group/directory
Asher31 Aug 25, 2013 6:50 PM (in response to Jump_Over)Awesome thank you that worked a treat... just wondering how would i go about showing multilevel groups? Do i just add a '/' or '\'?
Also, and i know this is going a beyond the scope a little, how would i target an entire book to do this too? Is that even possible.
Thanks so much for taking the time to help me,
Asher

