How to know if a applied paragraph style has changed

in Applescript, is there a propertie to know if a applied paragraph style in not "the original"
==> title become title+
Thanks

One way to do it in Applescript:
tell application "Adobe InDesign CS6"
          tell document 1
                    tell page 1
                              tell (every text frame whose label is "frame1")
  -- paragraph 1 has no style overrides
                                        return style overridden of paragraph 1 --> false
  -- paragraph 2's leading is different
                                        return style overridden of paragraph 2 --> true
                              end tell
                    end tell
          end tell
end tell

Similar Messages

  • [JS or AS] Applying Paragraph Styles.

    Hi,
    I have a JavaScript From Dave Saunders. Which Takes a list of all Para and Character styles from an InDesign File and make a .txt file.
    Which works great.
    So because I don't understand JavaScript and Very Basic Applescript.
    I have made a basic AppleScript which Creates a Document and place the .txt file which the JavaScript created.
    I know how to apply a Paragraph Style in AppleScript using the
    set applied paragraph style of paragraph 1 to ParaName
    My problem is I don't know how I can match and apply Paragraphs Styles and Character styles from the list generated from the .txt file to the corresponding Paragraph and Character styles in InDesign?
    Obviously if it could be all done Via JavaScript then yeah, otherwise AppeScript all do as well.
    Any help or ideas would be great.

    Thanks Shane
    Oh I didn't think I had to set myStory to anything as it's the only story, so I thought it's would automacticly make it the parent story...learn something new...
    I also forgot to import the Paragraph Style into the new document which I've fixed,
    but It falls over at the set applied paragraph line.
    tell application "Adobe InDesign CS3"
         --Pick file to import styles from
         set myFilePath to (choose file)
         --Create a new document.
         set mydoc to make document
         tell mydoc
              import styles format text styles format from myFilePath
         end tell
         tell page 1 of document 1
              set newFrame to make new text frame with properties {geometric bounds:{1, 1, 275, 210}}
              -- this line below will let me choose which file to place, in this case it's called MyDocumentStyles.txt which the Javascript made
              place (choose file) on newFrame
              set myStory to parent story of newFrame
              repeat with i from 1 to count of paragraphs of myStory
                   set thisStyleName to contents of paragraph i of myStory
                   if last character of thisStyleName = return then
                        set thisStyleName to text 1 thru -2 of thisStyleName
                   end if
                   set applied paragraph style of paragraph i of myStory to paragraph style thisStyleName
              end repeat
         end tell
    end tell

  • How to apply paragraph styles to xml tag?

    Hi All,
    How to apply paragraph style to xml tag?

    Hi Learner,
    Try the below js code.
    var myDoc = app.activeDocument;
    try{
        mySel=app.selection[0];
        myDoc.xmlElements[0].xmlElements.add({markupTag:"TEST", xmlContent:mySel});
        }catch(e){
            alert(e);
    var myDocument = app.activeDocument;
    app.findGrepPreferences.appliedParagraphStyle = "test";
    app.findGrepPreferences.findWhat = ".+(?=\\r)"
    var mySearch = myDocument.findGrep(false);
    for (a=0; a<mySearch.length; a++){
        myDocument.xmlElements[0].xmlElements.add({markupTag:"TEST", xmlContent:mySearch[a]});
    thx,
    csm_phil

  • Find.text Then apply Paragraph.Style

    Hi Everyone,
    Is that possible we find the text then apply the paragraph style every find text.
    We find [CN] then apply paragraph style "Chap_Num", Find next  [CT] apply PS "Chap_TTL" Find next [COX1] apply PS "Chap_Para".
    Any trick find and apply para style one time.
    Thank you! I appreciate your help and explanation Adv.

    @s_ashok – you'll find the right methods and properties in the CHM file for InDesign CS2 at:
    http://www.jongware.com/idjshelp.html
    Just a few hints:
    InDesign CS2 does not support GREP search/replace, so every line in your code that points to GREP does not work.
    Further: "app.findTextPreferences" and "app.changeTextPreferences" were "app.findPreferences" and "app.changePreferences" in InDesign CS2. And then there were no "findChangeTextOptions" or any counterpart for that in CS2…
    That should get you running…
    I have no InDesign CS2 installed to debug, so this is all I can say…
    Uwe

  • Auto apply paragraph style

    Hi all,
    I m new to indesign scripting. I need a help to correct my script.
    Its a basic scritpt to created to apply paragraph style 1 to the basic paragraph . after doing this, i want to apply the paragraph style 2 created to the next paragraphs likewise and so on.
    var myDoc = app.activeDocument;
    app.findGrepPreferences = NothingEnum.NOTHING;
    app.findGrepPreferences.appliedParagraphStyle = myDoc.paragraphStyles.itemByName("[Basic Paragraph]");
    var myResult = app.findGrep();
    app.changeGrepPreferences.appliedParagraphStyle = myDoc.paragraphStyles.itemByName("Paragraph Style 1");
    var myResult1 = app.changeGrep();
        app.findGrepPreferences = NothingEnum.NOTHING; //to clear the selected paragraph panel
        app.changeGrepPreferences = NothingEnum.NOTHING; //to clear the changed paragraph panel
    Can anybody help on this, please.
    thanks
    babylon.

    what error does it give??
    try this
    var doc=app.activeDocument;
    function resetOpt(){ // saves the find change options and resets the to default
        var old_fCGOpts=app.findChangeGrepOptions.properties;
        var old_fGPref=app.findGrepPreferences.properties;
        var old_cGPref=app.changeGrepPreferences.properties;
        app.findChangeGrepOptions=NothingEnum.NOTHING;
        app.findGrepPreferences=NothingEnum.NOTHING;
        app.changeGrepPreferences=NothingEnum.NOTHING;
        return [old_fCGOpts,old_fGPref,old_cGPref]
    function restoreOpt(myOpt){
        app.findChangeGrepOptions.properties=myOpt[0];
        app.findGrepPreferences.properties=myOpt[1];
        app.changeGrepPreferences.properties=myOpt[2];
    var myOpt=resetOpt(); //save and reset Find/Change Options
    app.findGrepPreferences.appliedParagraphStyle = doc.paragraphStyles.itemByName("[Basic Paragraph]");
    app.changeGrepPreferences.appliedParagraphStyle = doc.paragraphStyles.itemByName("Paragraph Style 1");
    var myResult1 = doc.changeGrep();
    restoreOpt(myOpt); //restore previous find change options

  • [Basic Paragraph] style name change to NormalParagraphStyle?

    i m trying to edit existing paragraph style. i was do it through kEditTextStyleCmdBoss. My problem is : As the command is process the name of [Basic Paragraph] style is changed to NormalParagraphStyle and it is now editable. How i can make its name field again not changable(i.e. preserve its original property)?
    Regards
    Kannu

    Hi,
    Have you some solution?
    Best regards:
    Karoly

  • Why can't set Tracking=0, if  Paragraph Style has Tracking 0?

    oCharRange has Paragraph Style format Tracking=30
    if set:  oCharRange.CharacterAttributes.Tracking = 0
    It not working. Tracking  of  oCharRange still is 30
    Why can't set Tracking=0, if  Paragraph Style has Tracking <>0?

    You can set an iPod Classic to shuffle in a Playlist. Well, my Classic (running 1.1.2 PC) can.
    What are you doing after setting shuffle to songs in the Settings menu?
    What you need to do is scroll down to the Playlist of your choice and either:
    highlight the Playlist and press the Play button (which will play a song at random from that Playlist). When that song finishes, another song will be played - at random - from that same Playlist
    enter the Playlist and choose a song that you want to be played first. When that song finishes, another song from that Playlist will be chosen - at random - to be played.
    When songs are being played in shuffle mode (the random choice of song), you will see the shuffle icon in the top right corner of the screen. (It's the same icon when in shuffle albums mode.) What happens, that is different, in your case?

  • HAs anybody noticed how the MAc Book Pro Login button function has changed with OSX 10.9?

    Has anybody noticed how the Mac Book Pro login button function has changed with OSX 10.9?

    No one in this forum will...  this is the Mac Pro forum

  • Problem with footer in table style not applying paragraph style... or just me?

    I'm having a niggling problem making a table style with cell/paragraph styles for the header, body, and footer respectively. I want to make it as simple as possible for other users but one thing keeps tripping me up. I'll try and describe with screenshots. I'm using InDesign CS5 on Windows 7.
    I have a table style set up with cell styles for the header, body, and footer, and paragraph styles for each as well. Say I'm converting a list of generic text to this table:
    i convert it to my table style. The body style is a numbered list:
    I convert the header to an, err, Header. The cell applies the header paragraph style as I should expect:
    I convert the footer likewise, but it maintains the Body text paragraph style as an override!
    So naturally I clear the override and it works fine. But of course, I'd rather it acted like the header row. I can't work out where the override on the footer comes from and why it operates differently in this respect to the header row. There is nothing different about how the styles are constructed. Have I made a mistake somewhere, or is this correct behaviour I'm misinterpreting, or something...?
    edit: Here is the file, if that will help:
    https://www.dropbox.com/s/4kzgui1itaskuvz/strip%20list%20test.indd

    Hi,
    I was able to reproduce the issue you are facing.
    I will be logging a bug for this and it would be investigated.
    Thanks a lot for reporting the problem!!
    Javed

  • Most efficient way to apply Paragraph Style A to Paragraph style B?

    I'm looking for the most efficient way to all
    all aspects of an existing named paragraph style "A" to another named paragraph style "B". I'd especially like to find a keyboard-only way to do this.
    To my surprise,
    Copy Special >
    Paste doesn't seem to copy tab settings...(?) This leads me to suppose that other aspects of the source p'style may not be crossing the Great Paste Divide.
    Over the years I've used a variety of more or less clumsy multi-step, multi-tool "tricks" (including third-party plug-ins) to apply one named paragraph style to another, but knowing FrameMaker as I do I suspect there may be a truly efficient way to do what I want.
    Is there?
    Cheers & thanks,
    Riley

    Arnis:
    8.0p277.
    The Font family and style got Pasted -- that was immediately apparent. And based on all I know about F'Maker, I would've thought the tabs would go over.
    But when I opened the target p'style the Tabs area was completely blank.
    I'm not sure if anything else wasn't making it 'cross the Paste Divide: Once the Tabs weren't Pasted, I fell back to a different, brute-force strategy simply to get around the problem and return to work...
    Moreover, since the structured templates I inherited for this project are full of idiosyncrasies, I'll just file this one away under "The Templates Did It" and hope for better luck the next time I try the Copy Special thing...
    Cheers & thanks for your help,
    Riley

  • Applying paragraph style makes it BOLD

    I have lots of nice paragraph styles, and NONE of them specify bold in their definitions. Yet, every time I apply one of these styles, the paragraph is bold. I don't know what's going on. Do you?

    I've looked at your file, and basically it's what SRiegle has said, but I'm going to go into more detail to try to help you understand what's happening.
    If you look at the Character Style panel with no text selected you'll see the Bold style highlighted. This means it is set to the default and all new text you enter will have the Bold style. You want to change this to [None].
    Because the text all has Bold applied, at some point the font weight was changed manually on the paragraphs to Regular. This becomes an override of the character style and if you click in the text you'll see the character style change to Bold+. The paragraph style shows no plus sign because character styles are not considered overrides.
    Now the tricky part. When you change the paragraph style, the local override on the character style is removed, but not the Bold style itself, so the new paragraph style is applied along with the Bold character style.
    Is that making any sense?

  • Reg.Apply paragraph style

    Hi All,
    Can you please anybody help me that how to apply the paragraph style which is available in Indesign with case insensitive in find/change grep options.
    I have tried with below code but the style applying only with case sensitive.
              myStyleName = myString.substring(1, myString.length-1);
                if(myDocument.paragraphStyles.item(myStyleName) == "[object ParagraphStyle]")
                    myStyle = myDocument.paragraphStyles.item(myStyleName);
                    myName = myStyle.name;
                    app.findChangeTextOptions.caseSensitive = false;
                    app.changeTextPreferences.appliedParagraphStyle = myStyle;
                    myDocument.changeText();
                    app.changeTextPreferences = NothingEnum.nothing;
                    app.changeTextPreferences.changeTo = "";
                    myDocument.changeText();
                    app.changeTextPreferences = NothingEnum.nothing;
    Please help me to figure out this issue.
    Thanks in advance.
    Regards,
    Sathya Rani M

    Hi Jarek,
    Thank you for your reply. Actually I need to find the style name with tag from activeDocument.
    For eq. if <lrh> or <LRH> found in activeDocument then find the "lrh" style available in Indesign and apply.
    Here is my full code. Please look into it.
    var myDocument = app.activeDocument;
    var myDocument = app.documents.item(0);
    app.findGrepPreferences = NothingEnum.nothing;
    app.changeGrepPreferences = NothingEnum.nothing;
    app.findChangeTextOptions.caseSensitive = false;
    app.findGrepPreferences.findWhat = "(?i)^<\\s*\\w+\\s*>";
    var myFoundItems = myDocument.findGrep();
    if(myFoundItems.length != 0)
            var myFoundTags = new Array;
            for(var myCounter = 0; myCounter<myFoundItems.length; myCounter++)
                myFoundTags.push(myFoundItems[myCounter].contents);
            for(var i = 0; i < myFoundTags.length; i++)
                myString = myFoundTags[i];
                app.findTextPreferences.findWhat = myString;
                myStyleName = myString.substring(1, myString.length-1);
                if(myDocument.paragraphStyles.item(myStyleName) == "[object ParagraphStyle]")
                    myStyle = myDocument.paragraphStyles.item(myStyleName);
                    myName = myStyle.name;
                    app.findChangeTextOptions.caseSensitive = false;
                    app.findChangeTextOptions.includeFootnotes = false;
                    app.findChangeTextOptions.includeHiddenLayers = false;
                    app.findChangeTextOptions.includeLockedLayersForFind = false;
                    app.findChangeTextOptions.includeLockedStoriesForFind = false;
                    app.findChangeTextOptions.includeMasterPages = false;
                    app.findChangeTextOptions.wholeWord = false;
                    app.changeTextPreferences.appliedParagraphStyle = myStyle;
                    myDocument.changeText();
                    app.changeTextPreferences = NothingEnum.nothing;
                    app.changeTextPreferences.changeTo = "";
                    myDocument.changeText();
                    app.changeTextPreferences = NothingEnum.nothing;
    But it is applying style only if "lrh" is present. It should be find case insensitive. please help me out.
    Thank you.
    ~Sathya Rani M

  • Applying paragraph styles to placed text

    I have a catalog document built  with with master pages and paragraph styles. The layout has a grid of  image boxes for product with a text box beneath for descriptions. The  text boxes should have style 1 applied to the 1st line, and style 2  applied to the following lines. Style 1 is applied to the text boxes in  the master, and has next style set to style 2 in the paragraph style  settings. This works fine when typing directly in the document, but I am  placing the text from a word document. When I place the text, InDesign  is just applying the default text settings instead of the correct  styles. Is there a way to get it to automatially apply the correct  styles, or will I need to manually set the styles?
    Using CS5
    thanks,
    Katie

    Part of your answer is very easy: after you've placed your text, select a few paragraphs, and then right-click on "style 1" and select "Apply Style, Then Next Style." That's how to use "Next Style" on text that you've placed.
    The other part of your question -
    When I place the text, InDesign  is just applying the default text settings instead of the correct  styles. Is there a way to get it to automatially apply the correct  styles, or will I need to manually set the styles?
    is a fair bit more complicated. If you're placing Word files, and all of the text in Word is styled with "Normal," then you'd probably need to manually set styles. If the text is in Word, but is styled carefully, then you can click the "Import Options" checkbox upon placing, and you can do all kinds of things to the file, including stripping all Word formatting & mapping Word styles to InDesign styles. If you have text in some other format, it may be possible to automate styling, but it depends completely on what you have to place. Raw text with XML tags? CSV files? RTFs generated by a translation memory tool? If you can post example files or screenshots, we may be able to figure out a way to smooth out this part of your workflow, depending on the materials with which you're working.

  • FIND/CHANGE - Applying Paragraph Style

    Hello,
    I used FIND/CHANGE to apply my paragraph style and when I apply the paragraph style... it applies the style to the entire line.
    For example,
    A. #70712       resulted to         A. #70712
    I only wanted the "#70712" to be changed to my style. I used the GREP search and entered #.+ and then I choose the paragraph style I want and clicked change all. The problem is that it changed all the text on that line and applied the paragraph style.
    Please help. Thank you very much.

    graphicsoc wrote:
    Hello,
    I used FIND/CHANGE to apply my paragraph style and when I apply the paragraph style... it applies the style to the entire line.
    For example,
    A. #70712       resulted to         A. #70712
    I only wanted the "#70712" to be changed to my style. I used the GREP search and entered #.+ and then I choose the paragraph style I want and clicked change all. The problem is that it changed all the text on that line and applied the paragraph style.
    Please help. Thank you very much.
    If I understand your request correctly:
    If your paragraph style uses a numbered list to create the "A." and the remainder of the paragraph consists of only "# 70712" that you type in manually (or place from an existing file), I believe that you you don't need GREP. You can format the auto-numbered list differently from the remainder of its paragraph, by specifying a character style for the number portion.
    To extract only the non-numbered portion of an auto-numbered paragraph, for a TOC, in the Table of Contents dialog box, open the bottom part by clicking More Options if necessary, and in the Numbered Paragraphs pull-down menu, select Exclude Numbers.
    Read more about Table of Contents in Help, and/or with a Google search for terms like "InDesign table of contents numbered list exclude numbers" without quotes.
    If you need additional special formatting "tricks" in the source paragraphs, or in the TOC entry paragraphs, look into Nested Styles and GREP
    Styles in Help or Google searches.
    HTH
    Regards,
    Peter
    Peter Gold
    KnowHow ProServices

  • Applying paragraph style to a single paragraph affects all previous paragraphs

    Hey,
    I'm trying to create a script that would take an array of text objects that describe what the text and style of a particular line of text is. And in some lines to apply Character Styles as well.
    The problem is that, while the script works when the loop is in the character styles "mode", it seems to apply the paragraph styles to all the previous lines of text when the aforementioned object asks it to apply only the paragraph style (no character styles).
    The offending line is this:
    if ( typeof line.text == 'string' ) {
        frame.contents += "\r" + line.text;
        frame.parentStory.paragraphs[-1].appliedCharacterStyle = doc.characterStyles[0];
        frame.parentStory.paragraphs[-1].applyParagraphStyle(style);
        continue;
    I even copied the style-apllying lines from the Character-Styles-applying section of the script (the else part), but it still applies the style to all the previous lines of text. The script below is the full code I have I long with one of the objects that text data. If I comment out the "offending lines" mentioned above, the script applyes all the styles correctly. Otherwise, only the last line (the Product - Description style) is applied, while all the previous lines attain the 'Spacer' style.
    Can anyone see what I'm doing wrong? (sorry for the giant piece of code, but I can't pin-point what's not relevant here).
        'text': [
                'style': 'Product - Title No Indent',
                'text': [
                    'Test Product',
                        'style': 'Superscript',
                        'text': '®'
                    ' Title'
            { 'style': 'Spacer', 'text': ' x' },
            { 'style': 'Spacer', 'text': ' x' },
            { 'style': 'Spacer', 'text': ' x' },
                'style': 'Product - Description',
                'text': ['Designed for monitoring steam sterilization processes.']
    function add_text_to_frame (frame, product) {
        var i, l, j, k, line, style, line_styles, char_style, line_text, bit;
        for ( i = 0, l = product.text.length; i < l; i++ ) {
            line = product.text[i];
            style = doc.paragraphStyles.item( line.style );
            if ( typeof line.text == 'string' ) {
                frame.contents += "\r" + line.text;
                frame.parentStory.paragraphs[-1].appliedCharacterStyle = doc.characterStyles[0];
                frame.parentStory.paragraphs[-1].applyParagraphStyle(style);
                continue;
            else {
                line_styles = new Array();
                line_text = '';
                for ( j = 0, k = line.text.length; j < k; j++ ) {
                    bit = line.text[j];
                    if ( typeof bit == 'string' ) {
                        line_text += bit;
                    else {
                        line_styles.push({
                            'start': line_text.length,
                            'end': line_text.length + bit.text.length,
                            'style': bit.style
                        line_text += bit.text;
                frame.contents += "\r" + line_text;
                frame.parentStory.paragraphs[-1].appliedCharacterStyle = doc.characterStyles[0];
                frame.parentStory.paragraphs[-1].applyParagraphStyle(style);
                for ( j = 0, k = line_styles.length; j < k; j++ ) {
                    char_style = doc.characterStyles.item(line_styles[j].style);
                    frame.parentStory.paragraphs[-1].characters.itemByRange(
                        line_styles[j].start,
                        line_styles[j].end
                    ).applyCharacterStyle(char_style, true);

    Here's the shortest code with the problem I could come up with.... You can run it if you create two different default paragraph styles: 'Product - Description' and 'Product - Title No Indent';
    The problem is that the first line should have 'Product - Description' style, but it instead it gets 'Product - Title No Indent'.
    If I comment out one of the paragraphs, everything works fine. What's wrong?
    var doc = app.documents.add(),
        product, text_frame, i, l;
    product = {
        'text': [
                'style': 'Product - Description',
                'text': 'Designed for monitoring sterilization processes.'
                'style': 'Product - Title No Indent',
                'text': 'Designed for monitoring sterilization processes.'
                'style': 'Product - Description',
                'text': 'Designed for monitoring sterilization processes.'
    text_frame = doc.pages[0].textFrames.add();
    text_frame.geometricBounds = [ '0pt', '0pt', '240pt', '300pt'];
    for ( i = 0, l = product.text.length; i < l; i++ ) {
        text_frame.contents += "\r" + product.text[i].text;
        text_frame.parentStory.paragraphs[-1].appliedCharacterStyle = doc.characterStyles[0];
        text_frame.parentStory.paragraphs[-1].applyParagraphStyle(
            doc.paragraphStyles.item( product.text[i].style )

Maybe you are looking for

  • Essbase 11.1.2.1 configuration error " Error while initializing registry."

    I have installed Essabase 11.1.2.1 components successfully in linux(RHEL 5) and while configuring the shared services first time getting the error :Error while initializing registry. unable to navigate from registry wizard state" In the configtool lo

  • N73 Restarts at beginning of flash then fails!!!

    Hi all i had my phones firmware updated before,but now i can do it at home. it is not branded but when i try to flash it using the NSU, it gets recognised, then it downloads the files, but when it begins to flash the phone restarts right at the beggi

  • Subreports require database logon

    Hi, I have written a crystal report with several on-demand subreports. This report is deployed within Business Objects Enterprise XI. When I view the report from InfoView and click on one of the subreport links it prompts me to enter database logon i

  • Oracle E-Commerce Gateway - 11i

    Hello, This is on 11.5.10.2 I have a need to setup trading partner groups and trading partners for roughly about 120,000 customers and EDI sites. As you can see, manually entering these many sites in Oracle E-Commerce Trading partner group is a hugel

  • Sysvol&Netlogon_Not appear

    Dear All I have a 2012 AD Server and add a new 2012 AD Server for BDC, however, after the second AD Server join into the first DC, the Sysvol, netlogon do not create auto and shared.  The first AD Server's Sysvol and the netlogon is normal and shared