Nested styles in CS2. Absence of property appliedNestedStyle

In task I'm working on there is a subtask of extracting overrides from the text.
The way I implement it is pretty straightforward: I iterate through all textStyleRanges. With each textStyleRange object I compare its style properties with style properties of paragraphStyle and characterStyle that are applied to it.
Things are getting harder when nested styles come into play.
When they are applied, they should be taken into account along with appliedParagraphStyle and appliedCharacterStyle.
This issue also affects Drop Caps. When the character style is applied to Drop Cap this character style becomes nested.
In CS3 scripting objects (textStyleRange, text, etc) has property appliedNestedStyle. So to extract overrides I can use it.
But in InDesign CS2 there is no such property...
So the question is how can I get applied nested style in CS2? Or maybe some workaround to accomplish the same goal?

Indexes
Scripting indexes has changed a lot. It finally works, and it works well. The property 'subtopic' has gone, instead you iterate the property 'topic' (up to three times). The following lines illustrate:
if( app.activeDocument.indexes.length == 0 )
myIndex = app.activeDocument.indexes.add()
else
myIndex = app.activeDocument.indexes[0]
//create main topic
myIndex.topics.add('dog')
//create subtopics
myIndex.topics.item('dog').topics.add('collie')
myIndex.topics.item('dog').topics.add('setter')
myIndex.topics.item('dog').topics.item('collie').topics.add('border collie')
myIndex.topics.item('dog').topics.item('collie').topics.item('border collie').topics.add('*****')
You can address (sub)topics by asking for topics embedded under topics:
myIndex.topics[0].topics[0].topics[0].topics[0].name
is the first subtopic of the first subtopic of the first subtopic of the first topic.
A new property is allTopics: myIndex.allTopics returns an array of all (sub)topics. This is a flat, one-dimensional, array, i.e. it returns the whole index but without structure.

Similar Messages

  • Nested styles and textStyleRanges

    HI all!
    I have to recognize all textStyleRanges in my documents.
    Unfortunately character styles described by a nested style are not really applied to the text and the paragraph looks like a single textStyle range.
    Is it possible to apply the characterStyles from nested styles?
    thanks.
    Ivan

    Ok. You could test every single character with the property appliedNestedStyle. That will give you an array of applied nested styles. The result would be an undefined object (case: no nested style applied) or an array of length 1 or length >1 if more styles overlap on a certain character.
    Code:
    var myCharacterStylesArray = myCharacter.appliedNestedStyles;
    for(var n=0; n<myCharacterStylesArray.length;n++){
        $.writeln(myCharacterStylesArray[n].name)
    The problem here is: which of the styles will win to format the character?
    My tests are showing (and I could be dead wrong!), the last listed style in that array will list the winner.
    Code for testing  a selection of some characters with different nested styles or GREP styles (with overlapping results)  applied:
    var selectedCharacters = app.selection[0].characters;
    for(var n=0;n<selectedCharacters.length;n++){
        try{
        $.writeln(selectedCharacters[n].appliedNestedStyles[selectedCharacters[n].appliedNestedStyles.length-1].name);
        }catch(e){};
    exit();
    If there are no applied nested styles, the try/catch will prevent this loop ending throwing an error.
    Of course we have to factor in a regular applied character style as well:
    var selectedCharacters = app.selection[0].characters;
    for(var n=0;n<selectedCharacters.length;n++){
        try{
        if(selectedCharacters[n].appliedCharacterStyle.index === 0){
            $.writeln("The winner is:"+"\t"+selectedCharacters[n].appliedNestedStyles[selectedCharacters[n].appliedNestedStyles.length-1].name);
        else{$.writeln("The winner is:"+"\t"+selectedCharacters[n].appliedCharacterStyle.name)};
        }catch(e){};
    exit();
    Phew, this took me a while to find out…
    Uwe

  • Creating Styles.. and then nesting styles

    Seems simple enough:
    tell application "Adobe InDesign CS5.5"
    tell active document
      set myCharacterStyle to make character style with properties {name:"Year", size:26.0, fill color:"Paper", stroke color:"Black", stroke weight:0.75, font:"Helvetica", font style:"Black"}
      set myCharacterStyle to make character style with properties {name:"Years", size:18.0, fill color:"Black", stroke color:nothing, stroke weight:nothing, horizontal scale:80.0, vertical scale:80.0, font:"Helvetica", font style:"Black"}
      set myParagraphStyle to make paragraph style with properties {name:"Year"}
      set nested styles of myParagraphStyle to {{applied character style:"Year", repetition:1, inclusive:false, delimiter:any word}, {applied character style:"Years", repetition:2, inclusive:true, delimiter:any word}}
    end tell
    end tell
    The font and the point size do not come through when the style is created. The nested styles also do not come through.
    I tried applied font:"Helvetica" to get 'font family not available'. Also, font:font "Helvetica"...
    What I get right now I is no font defined or size. The rest works.
    So what am I doing wrong here?

    Hi lithodora,
    as Mary Posner wrote a character style doesn't have the property 'font', but 'applied font' and 'font style'.
    "... specified as either a font object or the name of font family."
    just look it up in the dictionary ...
    Try always to work with references.
    tell application "Adobe InDesign CS5.5"
        --you've got to set myHelvetica to your needs!
        set myHelveticas to (font family of every font whose name contains "Helvetica") --will return the helvetica font familiy names
        set myHelvetica to item 1 of myHelveticas --just randomly pick one for my example, hoping it's got a 'black' style ;-) ...
        tell active document
            set myCharacterStyle01 to make character style with properties {name:"test", size:26.0, fill color:"Paper", stroke color:"Black", stroke weight:0.75, applied font:myHelvetica, font style:"Black"}
            set myCharacterStyle02 to make character style with properties {name:"tests", size:18.0, fill color:"Black", stroke color:nothing, stroke weight:nothing, horizontal scale:80.0, vertical scale:80.0, applied font:myHelvetica, font style:"Black"}
            set myParagraphStyle to make paragraph style with properties {name:"nextTest"}
            tell myParagraphStyle
                make new nested style with properties {applied character style:myCharacterStyle01, repetition:1, inclusive:false, delimiter:any word}
                make new nested style with properties {applied character style:myCharacterStyle02, repetition:2, inclusive:true, delimiter:any word}
            end tell
        end tell
    end tell

  • Find/Change problems within a nested style?

    I have a problem with Find/Change (in both CS4 and CS5) not recognizing text within its “find” parameters when text that fits those parameters is part of a nested style. I want to find any instance of italic in the text, regardless of what paragraph or character style it is, but F/C only intermittently finds italics, both within and without that text existing in a nested style. Has anyone come across this issue?
    There is NOTHING different about the text that is recognized by F/C–or not recognized–that shows up in any of the panels or palettes. There are no font conflicts. I’ve replaced prefs and saved data files. If I go into the character palette and change the italic portion of the nested style to “italic” character style (it shows up in character palette as [none], even though it has a nested style), then F/C finds it for sure; but if I don’t do that, then F/C will sometimes find it, and sometimes not, and sometimes in one instance and not in another! There is no hidden formatting that shows up in story editor. I remade another nested para style with the same formatting but with varying results! Help… I’ve tried everything.

    I have a problem with Find/Change (in both CS4 and CS5) not recognizing text within its “find” parameters when text that fits those parameters is part of a nested style. I want to find any instance of italic in the text, regardless of what paragraph or character style it is, but F/C only intermittently finds italics, both within and without that text existing in a nested style. Has anyone come across this issue?
    There is NOTHING different about the text that is recognized by F/C–or not recognized–that shows up in any of the panels or palettes. There are no font conflicts. I’ve replaced prefs and saved data files. If I go into the character palette and change the italic portion of the nested style to “italic” character style (it shows up in character palette as [none], even though it has a nested style), then F/C finds it for sure; but if I don’t do that, then F/C will sometimes find it, and sometimes not, and sometimes in one instance and not in another! There is no hidden formatting that shows up in story editor. I remade another nested para style with the same formatting but with varying results! Help… I’ve tried everything.

  • Finding "End Nested Style Here" option

    Hi,
    How to find and replace the "End Nested Style Here" marker through InDesign CS3-JS.
    Thanks,
    P. Ramkumar

    If you use findText, you can find it using ^h
    In findGrep it is ~h
    Dave

  • How do I create a table of contents with a nested style paragraph?

    I'm having difficulty figuring out how to generate my Table of Contents with a nested style. In this screen shot, "SPECIAL EVENTS" is considered level one and the pink circled "Fittest Firm Challenge" is level 2. Because it is a nested style, it is picking up the entire paragraph. I don't want to put in a paragraph break because that would add too much space in the magazine since there are a lot of other listings like this. I've tried reading through other people's discussions but I'm totally lost with the explanations. Is there a simple workaround or solution to this?

    apricotanna wrote:
    I'm having difficulty figuring out how to generate my Table of Contents with a nested style. In this screen shot, "SPECIAL EVENTS" is considered level one and the pink circled "Fittest Firm Challenge" is level 2. Because it is a nested style, it is picking up the entire paragraph. I don't want to put in a paragraph break because that would add too much space in the magazine since there are a lot of other listings like this. I've tried reading through other people's discussions but I'm totally lost with the explanations. Is there a simple workaround or solution to this?
    You're asking InDesign to do something it's not designed to do, namely, to treat a nested-style section of a paragraph as an independent paragraph. That's called a "run-in paragraph" in Adobe FrameMaker, and it's been a beloved feature there since FrameMaker was introduced in '89, about ten years before InDesign.
    You can make a formal feature enhancement request here: Wishform Many InDesign features have come into being from user requests, so lend your voice, and be patient. Explain why you think a run-in paragraph feature would be useful.
    Others have asked about this, and there are a number of workarounds that may or may not be suitable for you. Let's hope that some of the more-intense forum folks can help you with a useful search term for this forum, so that you can review what's been suggested and tried in the past, and what results you can expect.
    In the meantime, you might consider inserting the second-level heading in an inline anchored text frame in the paragraph. It will be an independent paragraph but you can adjust appear on the same line as following paragraph. Then you can extract it for the TOC.
    Here's an example:
    HTH
    Regards,
    Peter
    Peter Gold
    KnowHow ProServices

  • Using nested styles to break blocks of text into different pages

    Hello everyone,
    I'm treating data collected through a Google Docs form and I've already set it up so that the questions appear on the left and are followed by the respective answers sequentially so that I have a simple way to copy paste the whole information to Indesign. Then I'm going to use nested styles to define individual styles for the questions and answers.
    What I can't do, however... and I'm not even sure if it's possible, is how to tell Indesign to break text that is laid out sequentially into different lines or to break blocks of text so that they start in the beggining of the next page without having to resize the text frames by hand.
    As a visual example this is what the data I've exported out of excel looks like:
    Question 1 (tab) Answer A1 (line break)
    Question 2 (tab) Answer A2 (line break)
    Question 3 (tab) Answer A3 (line break)
    Question 1 (tab) Answer B1 (line break)
    Question 2 (tab) Answer B2 (line break)
    Question 3 (tab) Answer B3 (line break)
    (and so on in groups of 3 questions)
    And I want to turn it into:
    Question 1 (turn the tabs into line breaks)
    Answer A1
    Question 2
    Answer A2
    Question 3
    Answer A3
    (and then start at the beggining of a new page)
    Question 1
    Answer B1
    Question 2
    Answer B2
    Question 3
    Answer B3
    I can't define the size of the text frames so that the next group of questions+answers starts at the beggining of a new page because some of the answers are multi-line fields and thus the number of lines of the answers are variable and they can come short of the text frame edge or pass it.
    Can anyone share some insight of how to do this (or if it is at all possible)?
    Thank you very much!
    MACC

    Thank you very much for your input.
    I'm trying to automate this process as much as possible because I don't want to have to crunch the data manually myself later on, instead just teach someone else how to do it.
    The first search and replace action seems basic enough but regarding the second one I would have to manually assign that paragraph style to the line where the data would break because one can only assign character styles in nested styles, right?
    Also I've heard that ID CS5 automatically creates new pages based on a template when you paste information inside the first page, is that so? That would be great because that way the person wouldn't have to manually create pages and link the contents throughout the document but instead simply open my template and paste the information within the first master page. That's not possible with CS4, is it?
    Thank you very much!

  • Can you edit an existing nested style in CS5.5?

    In a previous InDesign CS5.5 document, I created a paragraph style containing a nested style. The nested style applied a bold font to the first sentence only, with the rest of the paragraph appearing in a roman version of the same font.
    I'm creating a new document now and would like to use the same paragraph style/nested style combination, only with different fonts.
    Is there some way to edit an existing nested style, or do I have to create a new one for the new fonts?
    Thanks for your help.

    You can load the paragraph style in the new document and then change the font....
    In the new document , Go to Paragraph style panel flyout menu and then choose "load paragraph style"and then choose the file in which you have this nested paragraph style present.

  • What is wrong with my Nested Style?

    Hi guys,
    Frustrating times in InDesign when Nested Styles do not behave as i would like to. I would like to have a highlited text after the Hard Return or ":" a simple Character style Helvetica Bold like here.
    http://www.pixentral.com/show.php?picture=1gFC1qoFDCNkgJy3BmxEYZc3ZEAE0
    I don´t know what i am doing so wrong i get this Morse Code. The highlight stuff is mixing up everything. The highlight is deselected in the character style but keeps appearing...
    Any idea?
    Thanks
    Sebastian
    pd: i know the palettes are in Spanish but i guess is mostly understandable since the locations of things are the same.

    You are totally misunderstanding how nested styles work. Once hit the
    return key you're starting a new paragraph. If you want your text to
    pick up a character style after the colon then use a soft return instead.
    Bob

  • Grep Styles/Nested Styles from the end of the paragraph

    Hi -
    It appears that grep styles, and nested styles only allow you to apply styles from the beginning of the paragraph until the match.
    I'd like to be able to apply styles from the END of the paragraph going back.
    This would allow me to apply a non-breaking character style to the end of a paragraph to control "runts". You could make the last two words of a paragraph non breaking, or set a 15 character threshold.
    This wouldn't work for all cases, but I'm working with centered, non-justified text, so it should work fine. If the feature were there.
    I'm sure there are other things one could do with it as well.
    There's a good discussion, and a MANUAL work-around on
    http://pdsassoc.com/tipsCS/DeruntingParagraphs/index.html
    Tom

    I used your suggestion and reviewed the tutorial again.
    Sometimes a missing piece of info drives you nuts.
    Thanks again.
    My clients will love this enhancement.
    CS rocks.

  • Nested styles: I can't seem to make this work

    I can't seem to do this nested style: All Adobe Garamond. Headline: 24/25 centered. Return. Byline: 9/10 centered, stacked. "by" is italic with a .5, one inch wide  rule above. Return. Author's name is small caps with the same rule below. Return. Body text is 9/10 regular, first paragraph has a 3 line bold drop cap, the other paragraphs have a .25 indent.
    Nothing seems to work when I try to set this up. Rules everywhere...and I am supposed to have the document set up in 14 hours....help!

    Nested Styles are character styles added inside a paragraph style that  affect only certain parts of the text, based on trigger patterns that  you set up. Typically you would use a nested style to do somthing like make the first three words of a paragraph Italic, or make a price bold on a menu.
    It's probably technically possible to achieve your title using nested styles, forced line breaks as triggers, and paragraph rules above and below with the proper offsets, but what you want to do is not typically done with nested styles, but rather with a series of individual paragraph styles that are applied in rotation automatically using the "next style" attribute.
    Mikes example is using three paragraph styles for the heading. PStyle1 (just a place-holder name for a pragraph style here) is applied to the text Headline 2, and as part of that style defintion the "next style" is set to PStyle2. PStyle2 is applied to the By line, and its next style is set to PStyle3, which is applied to MW Design. Each of these lines is a separate paragraph (he should have shown you the non-printing characters so you could see the hard returns at the end of each line). PStyle3 should have its next style set to your style for the first paragraph of body text that includes the drop cap, and that one needs a next style set to the paragraph style for your other body text. This last body style should have the next style set to "same style."
    If you are typing directly in ID, for each story, set the style to PStyle1 and begin typing. When you hit Enter to move to the by line, the style will change automatically, and will change again each time you hit Enter until you are inthe second paragraph of the body copy, where it will keep the same style until you change it manually again.
    If you are working with imported text you can select an entire story froom the fiorst line of the title to the last last paragraph of body copy, then right click on the PStyle1 name in the Paragrapgh Styles panel and choose Apply PStyle1 and Next Style and the whole shebang will get the correct styles applied in one click.

  • Nested styles

    I'm using nested styles in one of my documents. Specifically, I'm creating a long schedule and putting the times in a different font than the meeting names. Works great visually, but I've noticed that the nested style isn't *actually* changing the character style. It picks up the attributes of the nested character style but still lists its Character Style as "None." Is there some way to tell it to indicate nested styles with the actual character name? It does reflect changes made to that character style; however, I had also intended to search on that character style, but that doesn't seem possible (unless I manually stylize all of them).
    Not a huge deal, but I was kind of annoyed by it.
    Phyllis

    That's the way it is.
    And here's a word of caution: Some people like to define styles by formatting the text first, then using the formatted text to pre-load the style definition dialog. There's a little check-box there in the dialog that says something like "apply to current selection" (defining a style doesn't automatically apply it).
    If you've highlighted text and restyled, then created a character style with the box checked, and added that character style to a nested style, the highlighted text will appear the same as any other paragraph with the nested style, except that the character style is really applied (and shows up) as an override in that single paragraph. Should you later decide to change the nested style definition to use a different character style in that position, the change WILL NOT BE reflected in that single paragraph, which can be a bit disconcerting.
    Peter

  • Using Nested Styles for Prices

    I wish to easily plug in Prices and have them automatically edited to fit the style I want.
    For example:  If I typed $3.59. . . .I would want it to show up as automatically.
    I am mainly concerrned with being able to apply Superscripts and Subscripts and erasing the decimal.
    A step-by-step explaination would be amazing!
    Thank you,
    - Jack

    Sorry, you can't do this with styles. Styles can change formatting of text, but cannot add or delete. For that you need to run find/change.
    You can search for (\.)(\d\d) and replace with $2 and set the change format to your superscript (probably with a local override rather than a style, as will become clear in a moment). It would be nice to limit this to only prices by adding a lookbehind for the dollar sign and dollar amounts, but lookbehinds cannot have varable length strings, so you would have to do one for each possible number of digits, like this:
    (?<=[$])(\.)(\d{2})
    (?<=[$]\d)(\.)(\d{2})
    (?<=[$]\d{2})(\.)(\d{2}) for 0, 1 and 2 digits in front of the decimal.
    You'll need a second query to add the "ea" if you don't type it, probably find \d with the find format set to superscript and change to $0ea This will leave the "ea" also in superscript, so you'll need a second query to fix that: (?<=\d)ea with the find format again set to superscript. Leave the change field blank and set the change format for normal position.
    All of these queries can be chained together to run in one operation using tools you'll find at http://www.kahrel.plus.com/indesign/chain_queries.html
    I WOULD use an ordinary nested style, however, to style make the prices large and orange. That would be None up to 1 $ and then your big orange style through 1 word (this may at first only make the $and dollar portion of the price big and orange, but once the decimal point is removed it shoould fix itself. If you add a space before the "ea" you'll need to apply the style through 2 words.

  • CS3: typography and end nested style delimiters

    Hello,
    I'm trying to trick InDesign into exporting INX files in which all nested style delimiters are marked by an ENS character (a processing instruction in the exported INX). This makes the transform to XML much easier, because you can group adjacent, like-styled text without actually processing that text to find instances of character delimiters.
    I've written a JavaScript to process a layout, inserting an ENS character at every instance of any non-ENS delimiter (as defined in the paragraph style). The problem is that this seems to affect the layout in unanticipated ways.
    All seems well -- the nested character styles are properly applied, and InDesign seems to be paying attention to the required character delimiters and ignoring the inserted ENS characters. Mostly.
    In some cases, the ENS characters affect the typography of a paragraph. They seem to adjust applied kerning. The flow of text adjusts slightly at the insertion of the ENS character.
    I'd much appreciate any input on how InDesign handles ENS characters, especially when they aren't called for by the nested style definition.
    Thanks,
    Andrea

    Hi Dave,
    Thanks for your speedy reply.
    There are enough instances of nested styles that we're trying to avoid explicit ENS characters at all cost. There will be so many of them to enter!
    So ENS characters affect the resolution of nested styles even when they aren't used as delimiters in the nested style definitions? Is InDesign essentially looking for either the declared delimiter *or* an ENS character?
    If so, is there any way that can be overridden?
    Thanks,
    Andrea

  • Problems with Nested Styles

    I'm trying to create a nested style in In Copy CS5. What I want for it to do is to create the first few words with a certain character style then revert back to the Paragraph style setting. I have the nested style set to end with the end nested style here special character but it seems to stay in the format of the nested style no matter what I do.
    Any suggestions?

    What I did is create a new document which comes in with a certain paragraph style by default (a certain font and regular type). When I created a nested style using a character style in the Paragraph style we normally use it did not seem to be working correctly. I would have to apply the same style from the paragraph styles menu for the nested style to apply correctly. Otherwise it would apply the nested style to the whole paragraph instead of ending after three words.
    Either way after fiddling around with it for awhile and closing and restarting InCopy a few times it appears to be working correctly.Whichj brings me to another question, do you have to restart InCopy for changes to take effect?

Maybe you are looking for

  • Exit Button in Travel Assistant - Area does not exist message

    My client is on EHP2 for SAP NW 7.0 SP15 & EHP5 for SAP ERP 6.0 SP12. I believe the portal is also in the process of being upgraded from 7.01 to 7.4 (although the issue I am having occurs in both new and old portal systems). The Homepage Framework wa

  • TS3694 I keep getting error code -3, what do I do?

    This is getting very frustrating. I searched the web and found no help. Please help me! Thanks in advance

  • VAT Issue with prepayment orders for China !!

    Hi All, The issue is specific with China country ! Today when we  are create a Prepayment  Order the VAT is triggered upon the Prepayment invoice. According to the auditors this is not the correct treatment of VAT. Tax should be triggered at the time

  • Workflow suggestions, please - Folder to Collection?

    I need some suggestions please of how to efficiently get images from Folders to Collections.  Within each folder I need to select images and place them in the same collection. What I'm currently doing is to set the required Collection as Target Colle

  • Auto restart failed fpr oracle VM guest

    Hello, I have created a guest using below command and was able to get xm list: # xm create testrac1.cfg # xm list Name ID Mem VCPUs State Time(s) Domain-0 0 543 8 r----- 7226.7 testrac1 1 8192 4 -b---- 11.9 I have used below cfg file to create testra