How to show/say top level group/directory
so have script forum changing styles, 1 problem still have don't know how or show top level of style (so 1 not in group).
here code below, need know put in instead of groupold/groupnew when style want use not in group/folder. in advance.
replacestyle("old", "h1", "new", "activiyh1"); replacestyle ("old", "h2", "new","activiyh2") function replacestyle(groupold , find, groupnew, replace){ try{ var mydoc = app.activedocument; importedstyle = mydoc.paragraphstylegroups.item(groupold).paragraphstyles.item(find); applystyle = mydoc.paragraphstylegroups.item(groupnew).paragraphstyles.item(replac e); importedstyle.remove(applystyle); } catch(e){ //alert (e) } }
i'm not sure if answer looking for: if style's parent document, it's top-level style:
if (mystyle.parent instanceof document) {
// mystyle not in style group
}
peter
More discussions in InDesign Scripting
adobe
Comments
Post a Comment