Detailed fonts change in paragraph styles

Hello

I have a script to change A B police police in all paragraph Styles in a document, but is it possible to go a little further with it?, so;

Change font "BOLD" "" ""

Police B "SemiBold".

Change font a "SemiBold".

Police B "regular."

No help at all on this one would certainly help me.

See you soon,.

Littlemookie

Oh!

Well, I checked the parameter "appliedFont" in JS help, and it seems to be able to accept two different types: a string (which is what I did), or a font type.

The font type is an object - it contains all kinds of important things, like what type it is (TrueType, etc.), as well as a full name. I think that you can not compare the fonts using a string, so I tried this on [*]:

If (app.activeDocument.paragraphStyles [i].appliedFont.fullName is "Arial Bold")

...

and that, finally!, works. The other lines can stay as they were.

[*] Excuses for not testing the previous suggestion. Usually, I do this, but in this case, I was so sure ...

Tags: InDesign

Similar Questions

  • How to change the paragraph style to each paragraph that contains only one anchored object?

    Hello

    I have a document in word that should be converted in indesign. The document contains instructions, each step followed by an image.

    I managed to import the document into Indesign and applied a paragraph with numbering style to everything (text, image).

    Now, how do I change the the paragraph style to each paragraph that contains only an image? I need to get rid of the numbering.

    Thanks in advance.

    If the images are all anchored objects, you can use find/replace to find the anchor point and change the paragraph style only once for all paragraphs.

  • error: application of fonts on the paragraph style

    Hi all

    I am facing a problem while applying fonts on the paragraph style. Below are my code.

    If (myDoc.paragraphStyles [a].appliedFont.name == "Helvetica Neue Light")

    {

    myDoc.paragraphStyles [a] .appliedFont = "Helvetica Neue LT Std";

    " myDoc.paragraphStyles [a] .fontStyle = ' Light 45."

    }

    The error is "police family is not available." asked but the fonts installed correctly and works well even if I do a request manually.
    If I apply the Light "Helvetica Neue Std 45" police anywhere in my (manual) document only once and run the script, and then his job very well.
    Where is problem?
    Any suggestion.
    Thank you
    Shonky

    The problem is, you can not apply "" Helvetica Neue LT Std"because you do not have a 'Light' in this font style; and you can't apply the style

    'light 45' first because you do not have a "Helvetica Neue 45 Light!

    That's what they call a classic "Catch 22" situation. Fortunately, there's another way: you can apply two fonts and style in a single command:

    app.activeDocument.paragraphStyles [2] .appliedFont = 'universe LT\t45 Light ';.

    (Note the font character and style tab inbetween family).

    Very irritating, it's your way to work when applied to the text, instead of a paragraph style. for a moment, you will get a pink text in the 'police' [Helvetica Neue 45 Light], and when you apply just the style, all is well again.

  • Is it possible to change the paragraph style (none)?

    Whenever I make a bulleted list or a numbered list, I get a syle of fonts that we don't use in our project.  I tried to change this style, but it is grayed out.  All other styles allow editing.  How can I change this default style (none)?  I did a search in the file help and on the forum but have not seen any results.  It's too simple or others are ok with this style.

    Thank you

    The choice is to apply other styles like I did, or simply to set your LI style, which is the way of pure HTML. The reason why I do that you cannot map the tag LI for printed documents. I have just started the list, select the style that I want and that's all. It is an extra step.

    What is behind this change is that people complained that the code should be clean and now it is the case, people are aware there is a down side.

    When no style is applied, as zero, the police will be what is defined by the browser. Try changing the default font in your browser for some obscure fonts and generates output. What you'll see is this obscure font. Now see the same output to another browser with a different default font.

    You may not modify any as Willam explained. None means that no style is applied so that applies the default value of the browser. You will see may not be in Arial, the next person may see as something else. Modify a CSS sets styles you include in this CSS. You apply the paragraph styles or you don't, as in no style is applied that in none.

    Clearer now?

    See www.grainge.org for creating tips and RoboHelp

    @petergrainge

  • Fonts change in between two InDesign Documents different paragraph styles.

    When I import a page of a document into another. The fonts in the paragraph styles change. They shouldn't because both documents use the exact paragraph styles and fonts. !

    This is what happens, the changes are there is one applied named style that is not the same between the two.  It could be that basic paragraph Style is defined differently (if all models are based on it), or it could be a character style.

  • Change the font style in a paragraph Style

    I have a code which changes the font of my paragraph style, but I also need to change the font style. I have the following code and the applied font style line is to throw an error.

    myStyle = app.activeDocument.paragraphStyleGroups.item("Headings").paragraphStyles.item("Heading 1");
    myStyle.appliedFont = "Microsoft JhengHei";
    myStyle.appliedFontStyle = "Bold";
    

    The code works without the last line in, but when he is in I get this error:

    Window Capture.png

    I looked on the site Jongware under Font Style:

    http://jongware.mit.edu/idcsjs5.5/pc_ParagraphStyle.html

    RichardM0701 wrote:

    As in the model DOM is misleading or my code is wrong?

    Surely not! (This first one, by the way.) Check this page of DOM; ther eis no such thing as "appliedFontStyle" for paragraphs.

    You can give a more his style associated with an object police do (what you must look first), or as a string, but the string must have a special format:

    "family style [tab]".

    and since this is Javascript, you must type the tab as '\t ': character

    myStyle.appliedFont = "Microsoft JhengHei\tBold";
    

    (You also must be sure that this police more combo style actually exists, or well ID will always throw an error.)

    This 'trick' is not in the presentation of the DOM commands, because (uh) Adobe don't think to mention. But you should not use the command for the basic syntax reference, for that you need to read Adobe's Javascript Programming Guide, and I'm sure he gets mentioned in there.

  • 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

  • Change the paragraph by Script Style

    Hello!

    I don't know if this is the right place for this question but since its related to scripting, I'll ask here.

    Is it possible to change the paragraph Styles InDesign with a Script?

    For example, I need set Format1 hyphenation to specific values properties without changing the other properties. For Format2, I need to change other properties such as the Glph scaling.

    Like I need to do this with a lot of files, I suppose that the best way to archive it could be a script.

    Is there someone who had an idea on how to do it?

    Thanks in advance

    Thomas

    You're right, this can be done very effectively with a (relatively) simple script. This is an excerpt from a longer script of mine which covers a changing choice of design of end minutes documents open at once:

    for (i=0; i
    

    For a list of all paragraph properties that you can change, look in the ESTK help or (in a more user-friendly way to read and search) in an online version of these same data: InDesign ExtendScript API (10.0).

  • Paragraph style of change after a Page break

    I'm completely new script, so I take what I found others and try to change it.

    What I'm trying to do is to edit a paragraph style that follows a page break symbol.  I have a script (below) that will change a paragraph style following a paragraph already predetermined style, so I guess it's done the same?

    Thank you!

    Changes after "category A" paragraph to "body text":

    app.findTextPreferences = null;

    app.findTextPreferences.appliedParagraphStyle = "topic A";

    var myResults = app.activeDocument.findText ();

    for (i = 0; i < myResults.length; i ++)

    .appliedParagraphS myResults [i].parentStory.paragraphs.nextItem tyle (myResults [i] .paragraphs [0]) = 'body text ';

    Hello

    Try this:

    ------

    app.findTextPreferences = null;

    app.findTextPreferences.findWhat = "^ P";

    var myResults = app.activeDocument.findText ();

    for (i = 0; i

    myResults [i].parentStory.paragraphs.nextItem (myResults [i] .paragraphs [0]) .appliedParagraphStyle = app.activeDocument.paragraphStyles.item ("text body");

    ------

    and check if your next "page break" para is not a blank line.

    Rgds

  • GREP to change paragraph style?

    Many people, I have a one for all what you out there smart people. I think GREP can be used to change the formatting in the next instance, but I have no idea how set up.

    I have a very long document, essentially a telephone directory of type list of names, telephone numbers, addresses, well over 150 pages. Paragraph styles are fairly simple, two only by registration. The name/phone number is "BOLD", with a tab on the right points pointing to a phone number that is aligned to the right of the column. The following lines are at the same level on the left, not fat, but indented 6pts. I placed the text file and assigned the NameListing paragraph style to the whole thing. I would like to use GREP to find lines of addresses and change the paragraph style NameListingAddress.

    Here's a screenshot to give you an idea of screen. The left column is correctly formatted with both styles, the right column is "raw", all paragraphs formatted with the paragraph style NameListing.

    What is an application suitable for GREP? If so, how I set it up to only change paragraphs who "do not have tabs? It would save me a crapload of time.

    Screen shot 2011-11-15 at 8.10.43 AM.png

    THANKS again! -Dina

    The easy way would be to do the reverse of what you're trying: together all the paragraphs of your NameListingAddress style (rather than NameListing). And then do a plain old ordinary search for tabs, do not put anything in the line of "change of...". "(or put another tab in) but the value of change in Format to the NameListing style paragraph in the context menu. Change (after you have checked some of them to make sure it's doing what you want).

    It is probably a way to do this with GREP, but it would be much more difficult.

  • Paragraph styles apply bad

    Hello. I have a strange problem here that I've never met before. Somehow my paragraph styles do not apply to the right. In the options, everything seems fine, but when I apply a certain style it turns into a bad (ultralight instead of ordinary for example) font style. When I try to apply a different style of paragraph after that they can also be programmed to the ultralight, even if they were working properly before styling that paragraph with the certainty of preset. If I change the font manually style to what it is supposed to be, the "+" - sign only appears next to the paragraph styles in the paragraph styles. Styles of police, UltraLight and the style of play seem to be considered compliant with the paragraph style.

    I created several passages until I encountered this error and they have no change, and display right. There is also the number "+" - sign next to their paragraph in the window styles paragraph styles. I can also change the paragraph style in these paragraphs, and nothing strange happens. It works very well in these frameworks of related texts. So it could be a problem with linked texts executives newly created, I suppose.

    I have two styles of paragraph for each goal, one for a dark and the other for a light background. They are named as follows: "[purpose] (black) ' and (brilliant) [purpose]", so that they begin with the same word pairs (I don't know, but maybe that's the key?).» None of my paragraph styles is actually St. to UltraLight. As I wrote, I had no problems with these styles two days ago, when I created them or yesterday. They began to occur today.

    I hope someone can help me. Thank you in advance.

    First thing to check is if a character Style is applied.

  • CS6 PH paragraph styles

    Hi, we do some HTML emails that conform to the body styles. Some independent tend to wide areas of text a bit, we need to set the style to 12px. Unfortunately the scale does not seem to translate the style non-after the name of the style. So when I click on the style, it's not back to 12px. Is this a bug... ?

    Thank you

    V13.0.6 pH6

    Lister

    Hello

    So I discovered that the text layer that has a transform applied to it cannot be 'reset' by using a paragraph style. The size of the font in a paragraph style will be applied first to the text, and then the transformation values will be applied. I don't think that there is a way to change the value of the conversion to 100% for a layer, unless it was first transformed into a smart object layer.

    Kind regards

    Steve

  • GREP find/replace + paragraph Styles

    Hello

    I'm editing a long document and have benefited from the assistance of the community already, but being new GREP Style, find/replace, I need to ask for additional help.

    Below a screenshot of the script (original). Two blocks of text you see anticipated by the icons have have styles of different paragraphs. Icons are placed like custom glyphs.

    Now, the last line with C2, 9, 14,... is the target of this post. They are buses of London and I created a paragraph with another icon. The copy that I work with unfortunately is as you see. Buses will follow «;»

    Resulting to place a \r after the semicolon and assign the new paragraph style. The item to work with is (probably) the last "," before the registration of the bus. All entries have it in the same way, where a search/replace global grep should work fine.

    My attempts:

    I used of a previous debate (? < =------;)) [^ ;] + $ to match everything from the end until the last semicolon, but then I found the problem preserving the matched characters and placing \r (using the (? < =-;). start at the beginning and stops at each point comma + space)

    So question: how to stop at the first semicolon at the end and replace the space with \r to create a new paragraph?

    Then, it is two question :-)

    From my previous attempts, I noticed that when you replace the semicolon + space with \r, and change the style of paragraph at a time (from Rail to Bus) caused the Rail paragraph style change (logic) to the style of Bus. So I tried to say the paragraph style of the track "Following paragraph Style is style of Bus" (and not to change the paragraph style in find/replace), but in a way that no longer works.

    Second question is: given to split the find/replace in two steps, how then transform / apply to newly created paragraph the correct style of Bus?

    Thank you in advance for your valuable assistance. So far, the community has been great!

    Antonio

    Original

    Screen Shot 2016-07-12 at 22.32.23.png

    Result for

    Screen Shot 2016-07-12 at 22.54.51.png

    Hi Antonio,.

    If I understand correctly, in 2 regex [1 click play with Multi/find-replace our friend Martinho da Gloria]:

  • Paragraph Styles files

    I need to create 300 paragraph styles based on my base for a project EasyCatalog. I'm looking to change my paragraph styles file manually in a text editor. I use CC2014.

    Where InDesign does not have such a file?

    Create a new document, create a basic styles to see the syntax, create a block of text with blindtext but each style used at least once, export as InDesign containing the tag text, read with a text editor, create styles with the same syntax, which import back into an InDesign document.

  • Can I clear throughout this paragraph style overrides the time?

    Sometimes when I change a paragraph style, the places where I applied it compliance. Why is this?

    I end up having to go through the entire document and pressing "Delete replacements." Is there an easier way?

    Thank you!

    Put in local form always trumps style.

    Try using find/replace, however, search for the style and replace it with the same style. Who could do.

Maybe you are looking for

  • Error Disk Cleanup utility

    the utility disk cleanup on my laptop has authorized the necessary files, a lot of films and documents on mine and my disks hard partners, how to restore these? Help, please!

  • MP3 player does not light after firmware update

    I recently downloaded the Sandisk firmware update software and completed the most recent firmware update. Everything is was the firmware update I turned off the player until the firmware has finished updating. It will not now power, or he can reset.

  • New password Wi - Fi and the need to upgrade the configuration on HP Photosmart C4780 wireless

    We got a new Verizon FiOS router through an upgrade and now have the new network name and password WEP. I use MAC OS X 10.10 (Yosemite) and does not know how I can change settings of the printer wireless to match the new router information. I tried t

  • Email is messed up

    While trying to perform a reboot on the computer my husband installed the automatic updates 25 Windos updater and since it is impossible to access the links in his e-mail.  They all open documents Word rather than work as links.  I have no idea what

  • After the splash screen says "Loading Windows" and then it stops.

    I can run an analysis tool, but nothing else, after you select Safe mode or any other mode, he stops. I changed the boot order, but he does not see the disk in the drive or he's ignorant.