Problem affecting the existing paragraph style

Hi all!

I have searched all morning and can't find a lot of good documentation on the use of existing scripts paragraph styles to HAVE. I know that you can build a live, but more specifically, I want to add in the tabs and don't see this as an option to add paragraph styles in one of the refs to javascript.

I do an "export log" that captures the version, date, time, artist name/layers assigned to help our team of quality control. My problem is that any new text added to the box ignores existing paragraph styles, and I do not see so he can apply what I have in the file.

I can find the style, so I don't know it exists, and I can also draw the text box, so I think that these paths are correct and working, it's just the applyTo seemingly does not. Here is my code below:

//get the textBox with the sign off content
exportLogText = docRef.textFrames.getByName("RT_Signoff");
//add the sign off text
exportLogText.contents += "v. " + versionLetter + "\t" + theDate + "\t" + timeStamp + "\tExport by: " + username + "\tLayers: " + layersExported;
exportLogText.contents += "\r"
//identify the "Export_Log" paragraph style that already exists in the AI doc
var paraStyle = docRef.paragraphStyles.getByName("Export_Log");
for (ps = 0; ps < exportLogText.paragraphs.length; ps++){
    paraStyle.applyTo(exportLogText.paragraphs[ps], true);
}
redraw();

Once it hits the applyTo line, the script stops. I found similar posts claiming this code should work, so I don't know what I'm missing! Any help is appreciated.

I found a similar code here:a paragraph style for blocks of text in the document

It's really a matter of aesthetics, but I can't stand the text to look like this:

issue1.PNG

When he could look like this!

issue2.PNG

Looks like it was a problem with my file which was causing the anomaly, not the script. Things seem to be working now! Thanks for the input guys!

Tags: Illustrator

Similar Questions

  • (JS) How to apply the existing paragraph styles to text in a textFrame

    @I have a definition called "Header" in my Document.

    How to apply this paragraph style "Header" textFrame selected with the text "This is my head" using JS

    Please advise...

    Thank you..

    @I have a definition called "Header" in my Document.

    How to apply this paragraph style "Header" in textFrame selected with the text "This is my head" using JS

    as directed by your initial thread in question that asked you to change only the text block selected, so I gave code such as

    myDoc1 = app.selection [0];

    but myDoc1 = app.activeDocument; lets you apply the styleforwholedocument

    FYI

  • Problems with character and paragraph styles!

    Hello

    I have a problem to inDesign that I don't normally.

    (I work on a macbook pro)

    I'm adding a text in a template document. I have two character styles and the paragraphstyles.

    This is how I work:

    I place my text I have the text box. (placing a word document) First I get all of the italicized words in the text placed and they give a character style: italic. Then, I want to give a definition to the whole text. It is a 'regular' from the same font of type version. When I do that, all of the text get this pink-ish marking meens that the text has not been completely changed the style AND a little plus (+) next to the paragraph style accurs. Normally I just press alternative (alt) as I click the paragraph style and thus cancels the problem. BUT when I do that now all the text becomes italic - witch is not in the selected paragraph style. Why?

    I'm really lost how can I solve this problem - I don't want to create a new document because it is a model that I use each month for a magazine and normally it works.

    Would be - this code in the word document? Or what?

    Thank you!

    best,

    Sara

    Create your paragraph style

    Paste your text

    Run the Script PrepText

    http://InDesignSecrets.com/free-scripts-help-fix-Word-formatting.php

    This will apply/create character styles etc. italic, bold in all the text that you pasted in this text.

    Select all of your text - and click the clear button the replacements at the bottom of the paragraph Style Panel.

    Simple and fast

  • I tried to solve the problems to the existing solution in this forum. I still get error 50405

    Dear,

    I use USB-6009 for controlling pumps, valves, and two Mass Flow Control. Each two cycle I get error 50405. I tried to solve the problems in the existing solution in this forum, but the error always showing each cycle 2 of the operation. I enclose my VI filled for the expertise, I was wondering if its design issue? Home shot of the error screen. Thank you.

    You have certainly a few design issues.

    The structure of stacked sequence tends to create more problems than it solves. I the have not used in new programs since version 1.2 of LabVIEW (in 1989). A state machine is a much better choice of architecture.

    Local variables can cause race conditions, copies of additional data, poor performance and it is difficult to debug code. There are special cases when they should be used, but these conditions are not in your code. Just wire directly on the terminals of control at the scene, the data will be used.

    My guess on the likely cause of your error is the use of several DAQ Assistant to perform the same task (with different data values) in each image in the sequence structure. With the arcitecture state machine that I suggested above, you would need one. The DAQ Assistant trying to be clever on the configuration and tasks of closing, but different instances do not speak with each other, so they don't know when to release the resources.  You might be able to do work if you used the DAQmx screw standard you have done with the task of digital output.  You do not connect the error lines of the DAQ Assistant for you can be missing errors.

    Indicators and controls without legend may be a troubleshooting nightmare. Please give each control and seeing a unique label. If you don't want the visible label on the front, you can use the properties of the control to hide. If you want multiple controls to have the same visible text for the operator, use the legend.

    Learn how to use subVIs. Most of the code in the 6 images of the structure of internal sequence is identical. By converting only a Subvi, you would reduce considerably the size of the diagram and if you ever need to modify the code, it should only be changed in one place - the Subvi.

    The while loop in frame 0 of structure of outer sequence is a "gourmet" loop He's going to run as fast as possible and seize all available CPU resources until the user presses a button. Put a wait function (ms) in the loop with expectation of ~ 100 ms. best, learn how to use the Structure of the event for user input.

    The second loop inside of the structure cases inside does nothing and can be removed.

    Many of these objects suggest that you have a programming background using the text-based programming language.  LabVIEW uses a paradigm of data flow that avoids largely for things such as the structure of the sequence and the local variables. I recommend that you work through the tutorials online on the Getting Started with LabVIEW.

    Lynn

  • problems affecting the correct size of fonts

    I have problems affecting the correct size of the font in mail and print, how do I return the policy to the original settings?

    Hello
    • What mail client do you use?
     
    It depends on what email client / browser you are using.
    Each browser / email client must have the print properties which should allow the user to adjust the print size.

    If you use IE, check the zoom settings. Do follow link below:

    http://www.Microsoft.com/enable/training/windowsvista/webzoom.aspx

  • Why can't define paragraph ball in the standard paragraph style?

    I want to configure my standard paragraph style so that I can quickly apply the individual paragraphs balls - using MY favorite dashes - without having to create a new style to the paragraphs of the ball. I tried to change the settings of the standard paragraph, with no document open style, but he doesn't seem to accept my choice of dashes. First of all, I selected bullets and put a dash, but then the default paragraph with bullets. When I pass the ball setting back to "none" the only thing he keeps is the last setting that I chose for the tabs. (At the same time, which changes the default tab for all paragraphs setting.) But when I create a new doct and start a paragraph of the ball, the hyphens by default always a.25 /-.25 and any tab setting LOWER a.25 results in the updated first line indented for the tab setting, but the rest of the paragraph indented a.25. There seems to be no way to change default indentation for bullets without creating a new paragraph style. And usually I'm fine with that. But I thought that I would have a default Quick using the standard paragraph style. Am I missing something or is it just not possible?

    Here is a Visual/verbal screenshot to help explain:

    InDesign-Bullet-Problem.png

    Let's see if I understand differently from others. You want to apply bullets manually from time to time without having to select a new style, you would do this by pressing the button bulleted list in the Control Panel, and you want the settings for tabs and indents, other than the default. Is this correct?

    Far as I can tell there is no way to do it. You cannot configure the settings for the chips unless the text cursor is active or if you set a style, there is no way to set up the new default values. You don't want to not set parameters whenever you need a ball, then either you type the balls by hand, tab and insert a hyphen character here, which is actually a lot more work, or you go ahead and set up the style. You can access the list of style in the menu drop-down control panel, or you can add a keyboard shortcut to give you quick access, or press Ctrl (Cmd on Mac) + entry for quick access to apply and start typing the name of the style (almost as fast as a keyboard shortcut).

  • Remove based on the substituted paragraph style attributes

    Is there a way to clear the attributes that you put in a "based on" paragraph style, on the part of start by resetting to the base?

    For example:

    • 1 a paragraph style track set to + 10.
    • You create 2 of paragraph 1-based Style and made several substitutions, including change tracking to + 5.
    • Now you realize you want the two styles have the same follow-up and you want to experiment with this setting.

    How can you erase what has been entered in the Style 2, so that any changes made to the Style 1 applies to the 2 Style once again? I realize that it is possible with character styles, but after scouring the net, I think that this should not be possible with paragraph styles.

    Am I wrong? If this is not the case, why it should not be possible?

    Thank you.

    Go to the 2 paragraph style definition and reset the traking to the same value as the base style. It becomes as well as watt do you the basic style. Only the attributes that are different are locked.

  • Image text wrapping negatively affects the balanced paragraphs - need help

    I have CS5 - 5.  I'm no expert, but I am using the program for a number of years in the design of flyers, brochures, posters and short brochures. Now I'm on my first magazine and I thought that all the features balanced new paragraph would work a breeze - it didn't! So, I have a page of A4 size with a block of text in two columns that fills (have also the text flows on the next page if it's relevant). The text is 10pt with a line spacing of 12 pt. Everything is good so far. I used paragraphs balanced in a first time to have the two columns of text aligning horizontally. Seemed fine. However, as soon as I drop an image into the mix, the width of a column (lower left corner of the page), simple text wrapping, text changed less satisfactorily. Text above won't come down to meet the upper part of the image, no matter what I put in measures to wrap text or what kind of film I use. Also the text to the right of the image is more down to the bottom of the text block. The problem is further compounded when I integrate a quote as a separate object.

    Then I disabled the balanced paragraphs feature and used a grid of base line instead, taking up many of the suggestionson another discussion and also using advice elsewhere on the net. Useful in a sense that it helped me to learn more about what baseline grid but I am still with my problem.

    I could be wrong, but I don't think that I ask the program to do anything complicated. It's not as if the text should wrap around the object. I know that I could get the effect I want to using single column text blocks and get text to flow from one to the other, but it is certainly not how it should be? If you like I can send screenshots, but I'm not sure it would help. I write this in the morning in England so I know that many of you will still be sleeping. However, once you have had your first cup of coffee of the day, maybe you could give me a little help? Needless to say that any advice that anyone could offer would be warmly accepted.

    Best wishes to all,

    John

    If I had to guess, by looking at your screenshots, I would say that you have a possibility to keep in your style on the last two lines of the paragraphs together and that there is not enough space to the bottoom of the image for more than two lines, but you do not have we shown the contours of the block.

  • Accessibility: Marking of the generated paragraph styles

    I'm trying to generate an accessible PDF file with FrameMaker 9.

    In the configuration of my book from the PDF file, I can define the order of marking to include or not to include several paragraph styles. However, none of my generated paragraph styles aren't in the marking list. For example, 1 H - HeadingTOC, IndexIX, styles etc. are unavailable and I can't mark those paragraphs in the release of my book.

    I tried to import those styles in my book, but this does not add the to the list.

    How tag paragraphs generated in FrameMaker 9?

    This means that the table of contents and Index of my book is inaccessible. This is not mentioned in FrameMaker 9 VPAT.

    Thank you!

    Myles,

    the Configuration PDF dialog box that reach you for a book seems to show only styles of present paragraph in the first file of the book. Could it be the source of your problem?

    -Michael

  • Change the paragraphs found in the standard paragraph style?

    I have look here for about an hour and could not find a discussion for this.  I see where it clears the substitutions but not change Style all together.  Here's what I need help do.  If I left saying text 4 selected boxes, I want the power to change the standard paragraph to paragraph and character set to None style style. If there is already can a discussion that I missed in this regard you point me in that direction.  If this is not the case, can I please help with this.

    You can usetpk1982of script to change all the paragraphs of the standard paragraph. But if you only want the block of selected text, then you will need to adjust thescript to change paragraph styles in the selected text frames.

    basically replace line 2 by var allTFrames = app.selection;
    Also, if you need to clear character styles need to do before you change the paragraph style or character styles will be removed and the formatting will be left as a local override.  Your final script after that these changes would be:

    myDoc var = app.activeDocument;

    var myTFrames = app.selection;

    for (var i = 0; i)< mytframes.length;="" i++)="">

    var tFrame = myTFrames [i];

    pStory var = tFrame.parentStory;

    var allParas = pStory.paragraphs.everyItem ();

    pStory.characters.everyItem () .appliedCharacterStyle = app.activeDocument.characterStyles [0];

    allParas.appliedParagraphStyle = app.activeDocument.paragraphStyles [1];

    }

    Note: instead of simply replacing the 2 wire I also changed the name of the variable to reflect rather than leave it in the form allTFrames; and add line 7... Other than these two changes everything was the script of tpk1982

  • How clear the text paragraph styles imported from the word?

    I am trying to create a user manual and I use a model that has its own set up paragraph styles.

    I use InDesign CS6 because I use the PDF2ID of Markzware plugin that I bought for this version. I used it to bring in the instructions of the users who have made their work in Word and saved in PDF format.

    I just want to take their work and re - format to match the styles of paragraphs in the model. But when I select the text and choose a new paragraph style, it does not change.

    I tried to use the button 'Clear the replacements' but nothing happens.

    I found a site that offers to use keyboard shortcuts to clear the formatting, but they no longer work.

    What Miss me?

    PDF don't know anything about styles. The plugin could have done a few "intelligently" all styles, based on the formatting, but I don't know if he is capable of that because I've never used.

    Hold Shift + Alt\Opt click a paragraph style should apply this style and remove character styles as well as local formatting overrides.

  • script to duplicate the standard paragraph style, and then change the size of the character point

    I want to create a script that will create a cascade of paragraph based on the style settings [standard paragraph] styles. My goal is to point size of each new paragraph style character as a percentage of the original [standard paragraph]. So if [standard paragraph] is 100% (point character size 10pt), the script would create a paragraph style called 120% ' that has a point size of character of 12 points. Then 133%, 140%, and on and on. I modified a script found on this forum to generate these new styles, but I don't know how to be based on the [standard paragraph]. Any help would be much appreciated, thanks in advance.

    current script:

    var doc = app.activeDocument,

    pStyle = ['100% ', '120% ', '133% '];

    for (var i = 0; i < pstyle.length; i ++)

    {

    If (pstyle [i] is "100 %")

    {

    doc.paragraphStyles.add ({name: pstyle [i], appliedFont: 'Deer', pointSize:10});})

    }

    ElseIf (pstyle [i] == "120 %")

    {

    doc.paragraphStyles.add ({name: pstyle [i], appliedFont: "Deer", pointSize:10 * 1,2})

    }

    ElseIf (pstyle [i] == "133 %")

    {

    doc.paragraphStyles.add ({name: pstyle [i], appliedFont: "Deer", pointSize:10 * 1.33333})

    }

    }

    Try this,

    var doc = app.activeDocument,
        pstyle = ["100%", "120%", "133%" ];
    
    for(var i =0;i
    

    Kind regards

    Cognet

  • Maintaining in the Group paragraph styles

    I have a flyer that runs vertically, from left to right. I have 3 styles of paragraph for the title.

    If there is no room for THE 3 styles of paragraph at the bottom of the text box is there a way to force them to move to the next text box WITHOUT moving the text box that they sit in?

    Thank you

    Steve

    In the paragraph for each paragraph Style - select sequence Options and choose "keep with next paragraph".

    This should force paragraphs to always stay together.

  • Script of the current paragraph style

    Can someone tell me what is the code to return the paragraph style for the current position of the cursor.

    Also I can I ask something to the current paragraph is not using paragraph styles.

    For example, what would be the code to "make the current text of paragraph Red.

    Help would be much appreciated as we see questions that I'm a complete Newbie in scripting.

    if (app.documents.length > 0 && app.selection.length === 1 && app.selection[0].hasOwnProperty("baseline")) {
         // return the paragraph style for the current cursor position
         alert("Paragraph style: " + app.selection[0].appliedParagraphStyle.name);
         // Make current paragraph text Red (the 1st paragraph in the selection)
         app.selection[0].paragraphs[0].fillColor = "C=15 M=100 Y=100 K=0";
    }
    
  • Count the unused paragraph styles

    I want to check InDesign documents my students to see if they have been neatly with their style sheets. I have a script that works partially (I think this would work in CS4, if you replace CS4 CS5).

    The bit that does not try to save the styles within groups. I commented in the script to display the error section. I get the error:

    "Invalid value for the set property" applied paragraph style". "Planned to string, the style section or anything, but will put \"body text (body). " "number 30477

    I tried to put the name of the style and the group, because that's how it works if you do it manually, IE body text (body). But it does not work.

    Any help would be appreciated.

    property myTypeReport: ' " - makes available anywhere.
    " game of myTypeReport to '" - prevents report becomes cumulative when running several times.
    Tell application "Adobe InDesign CS5"
    the value myDocument to rating 1
    game of unusedStyles to "'
    game of myFoundItems to "'

    game myDescription to "unused paragraph styles"
    the value myParagraphStyleGroups for each paragraph style group of myDocument
    the value myParagraphStyles for each paragraph style of myDocument

    Repeat with I have a 3 in (County of myParagraphStyles)
    define myStyle to the the point i of myParagraphStyles name
    the value find text preferences for Nothing
    the value text preferences to change anything
    the value applied paragraph style to find text preferences to myStyle
    tell myDocument
    the value myFoundItems to find text
    if (account myFoundItems) = 0 then the value unusedStyles to (unusedStyles + 1).
    end say
    end Repeat

    -This is the section of the error
    Repeat with x 1 to the number of myParagraphStyleGroups
    set myGroup to the of the point x of myParagraphStyleGroups name
    the value myParagraphStyles for this entire paragraph styles to paragraph style group myGroup of myDocument
    Repeat with I have from 1 to (count of myParagraphStyles)


    game of myStyle to (name of point i of myParagraphStyles) & "(" & myGroup & "") " string "
    -Returns the myStyle
    the value find text preferences for Nothing
    the value text preferences to change anything
    the value applied paragraph style to find text preferences to myStyle
    tell myDocument
    the value myFoundItems to find text
    if (account myFoundItems) = 0 then the value unusedStyles to (unusedStyles + 1).
    end say
    end Repeat
    end Repeat
    -finish the section error

    "myReport game to "(" & unusedStyles & "")" " & "\t\t" & myDescription
    if (County unusedStyles) > 0 then the value myTypeReport to myTypeReport & myReport and return
    return myTypeReport
    end say

    Can you make best use of all styles of paragraph in your document instead of styles of paragraph of the document, which should access the independent styles of groups? You would have to give on the name using as reference (probably a good thing anyway) and use the style itself (in your find/replace).

Maybe you are looking for