find MANUALLY applied character styles

Hi all

We switch to an XML stream, and as one of our interim steps we are applying tags to paragraph and character styles in some of our documents. I am aware of the ability to map styles to tags and it should work for paragraph styles well. However, we are looking for a way to map only character styles that were applied manually.

For example, we have a paragraph style for instructions which has some "BOLD" nestled at the beginning of each paragraph. In other places, the same style of characters may be used for "BOLD" a specific word, but it is applied manually. It is possible to map the tags THAN character styles that were applied manually? We do not want the labels identifying the character styles that have been applied through nested Styles or GREP Styles.

I guess it would take some kind of script, that's why I write in the forum script. Anyone know if this is possible?

Thanks in advance,

Matthew

Hi Matt,

Please try to code below, hope this helps.

applyTag("bold", "b");
applyTag("italic", "i");

function applyTag(StyleName, TagName)
{
app.findTextPreferences = null;
app.findTextPreferences.appliedCharacterStyle = StyleName;
list = app.activeDocument.findText();
app.findTextPreferences = null;
while (list.length)
{
     next = list.pop();
     if (next.appliedCharacterStyle == app.activeDocument.characterStyles.item(StyleName))
     {
          next.associatedXMLElements[0].xmlElements.add(TagName, next)
     }
}
}

Shonky

Tags: InDesign

Similar Questions

  • Need to get all the text of the particular applied character style

    Can someone help me I need to get all the texts of the particular applied character style

    app.findTextPreferences.appliedCharacterStyle = 'style1 Character. "

    app.findTextPreferences.appliedCharacterStyle = 'style1 Character. "

    var mf = app.activeDocument.findText ();

    var myText = ";

    for (var i = 0; i)<>

    myText is myText + mf [i] .silence;.

    }

    Alert (MyText);

  • GREP style - apply character style to the opening and closing parentheses surrounding a 0 (but not 0)

    Hello

    I'm relatively new to GREP style and will have to put in shape about 600 postcards containing various data (via the merger of data), including phone numbers. Consider the following data set:

    1. + 44 (0) 123467800

    2 (©) copyright

    3. (name of the program)

    I want to tell Indesign to stagger the opening and the closing parenthesis of the baseline (with a character style), but only the bracket that include a 0 and, possibly, without affecting the 0 value between them.

    Seems like an easy task, but it is impossible to find a solution. Could someone help?

    Thank you very much

    Antonio

  • Legends have the applied character Style

    Hello

    I am trying to add captions to a bunch of pictures and they all get a character Style applied for some reason any.

    I tried to select 'none' before creating captions without result.

    I have no idea why this character Style would apply at the same time as the paragraph Style, I chose.

    Any clue?

    Thank you.

    Anselect everything in your spead and check that the style is selected on your character range of Styles. What is [none]?

  • With the help of FindChangeList.jsx - can't find text AND character style?

    I have been using the "FindChangeList.jsx" script in CS5 and it works well for what I need, except for one thing: ideally I want to pick up a piece of text with a certain style of applied character. Is it possible to do something like

    Text {findWhat: 'some text', appliedCharacterStyle: 'character style name'}

    I tried the above, but it is basically ignored the character style and found all of the text corresponding to the sentence (unknown what character style has been applied). Any ideas?

    Thank you very much. HJ

    Problem solved-, I made two mistakes. First of all, the style is a paragraph not one style style character, and secondly, it has been grouped into a folder. So I moved out of the folder and changed the code to ' appliedParagraphStyle: ' (and everything worked fine.:).

    Thank you. HJ

  • Apply for a position in the character style

    Hello

    I am new to the script, I tried the below to find the Exhibitor code characters and apply character styles?  the code shows not all errors below. Can you someone please suggest the below code is correct or not?

    myDoc var = app.activeDocument;

    app.findTextPreferences.findWhat = NothingEnum.nothing;

    app.changeTextPreferences.changeTo = NothingEnum.nothing;

    app.findTextPreferences.position = Position.SUPERSCRIPT;

    app.changeTextPreferences.appliedCharacterStyle = 'exposing ';

    App.Documents.Item (0) .changeText ();

    app.findTextPreferences.position = Position.SUBSCRIPT;

    app.changeTextPreferences.appliedCharacterStyle = "index";

    App.Documents.Item (0) .changeText ();

    Kind regards

    Vinatier

    Strike fault! It should be:

    app.activeDocument.characterStyles.itemByName ("first");

  • Selection of parts and columns, or entire lines and apply the character style

    I am trying to apply character styles to certain parts/whole rows and columns.

    I can change individual cells with the following code...

    table = app.selection[0];
    if (table.hasOwnProperty("baseline")) table = table.parent;
    if (table instanceof Cell) table = table.parent;
    if (table instanceof Column) table = table.parent;
    if (table instanceof Row) table = table.parent;
    if (table instanceof Table)
    
    {
     table.rows[0].cells[6].texts[0].appliedCharacterStyle = "none report";
     }
    

    ... but when I try to select an entire line, I get the error 'Object does not support property or method' texts. "" "When I try one of the following two codes.

    {
     table.rows[0].cells.texts.appliedCharacterStyle = "none report";
     }
    

    {
     table.rows[0].cells.appliedCharacterStyle = "none report";
     }
    

    Anyone know how I can do the following?

    1. Select any row (or column) and apply the character style

    2. Select the last line (regardless of the number of rows in the table) and apply the character style

    3. apply the character style to specific columns (with theexception of the cells of two albums)

    Thank you!

    Hello

    Change this line:

    table.columns[a].cells.itemByRange(2,-1).texts.everyItem().appliedCharacterStyle = "chart orange";
    

    for the first 2 rows in each column

    Jarek

  • Character style strange applied when you create a new table

    Hi all

    I have a table style. This is controlled using the cell styles. Cell styles is controlled using paragraph styles. Nothing complicated here.

    When I create a new table by using the style, it seems. Accept that all of the text in the cells have an applied character style. So when I start to insert text in a cell, the text is formatted different style of paragraph, that I defined in the table style.

    If I remove any character hairstyle for all the text in the table, it seems just as expected.

    Any ideas on how to move forward with this? It's pretty annoying to have to select the table and remove all style characters before you can start using the table.

    Thank you!

    Martin

    Check that a character style is not selected by default before you create your table.

  • How to use paragraph and character styles properly?

    I have a document in which the text has two colors (which has no style)

    Black (normal) and Red (to highlight the keywords).

    I needed to put these 2 in a style

    (black) paragraph style

    (red) character style

    Here's my question.

    How can I make sure that when I use the paragraph style, she also uses the style of character but only on the Red words?

    While I need not find/replace every word manually

    I want to do at once.

    If you want to add styles to a document already created:

    (1) create your character style that contains only the color of the characters

    (2) search and replace a text with red color search and replace with the new character style formatting. (Do not type anything in the text portion of the find and Replace dialog box)

    (3) create and apply your paragraph style to all. The text with the applied character Style will stay red.

  • Application of large amount of copy character styles

    Hello!

    I am trying to apply character Styles to a large amount of copy and I can't understand it. I find tutorials on how to create them and use them, but I don't want to have to search all my text to style "italic". I hope that all makes sense. I thought that there was a way to apply a character Style to the text easily, but I can find no longer.

    I want to apply a character Style to some words in a large amount of text, and then apply Styles to a paragraph in the text box. actually not to change Styles of character to the breast.

    Does anyone know how to do this? Looks like it should be so simple!

    Thanks in advance!

    L.

    Is already italic text? If it is you can do a find/change GREP for. + and set the Format to find for italics, and then set the format change on your italic character style and change all. You should do this on a copy of the doc for safety.

  • Is it possible to update a character style with the changes I made to the selected text?

    I use InDesign CS5 on OS X Yosemite.

    I don't really know the best way to put it, so I hope that this scenario makes sense.

    Let's say I have a document with a few styles of different characters, and on one page of the document, I decided that I would try something different for a title that has an applied character style - this style is applied to all titles at the same level on the rest of the document. I do not adjust the style of character, however, but simply adjust the setting in shape in the upper character Panel. After playing for awhile, I have decide that I'm really this new setting in shape and want to apply as a result of the document, but now I don't have a character for this style.

    I know that I could just make a new style of form the title I have changed, then go back into the rest of the document and apply it to other styles. However, since this title still has the original style applied (just with overrides), I would like to know if there is a quick way to update the style based on the new formatting?

    I hope that makes sense.

    Thank you for your help in advance.

    With the substituted text still selected (you will see a + next to the character name of the Style in the character Styles Panel), choose the Style to redefine in the character Styles Panel menu.

  • How can I request a specific to a specific text character style?

    Long user date Photoshop and Illustrator. New to Indesign.

    Fortunately, this is not a matter of knowing how to create fractions. I have already chosen a route for it. I simply apply a character Style who ticked "fractions" of opentype.

    Here is an example of the content that I treat:

    ptable.PNG

    Above is my table style in Indesign, after pasting in the data me be given data in excel spreadsheets.

    How can I quickly apply my style "FRACTIONS of ptable_BODY" to only some texts, such as: "1/2" + 1/4 "+" 1/8 "& preference random arbitrary fractions like" 34/69"?".

    GREP can do great things, but it can selectively apply character styles?

    Maybe it's a job for a paragraph style. I'm not sure.  . .

    Do it with a GREP search:

    \d/\d

    which means: one or more digits, a /, followed by one or more

    figures.

    And replace with your chosen tank style.

    However, some OpenType fonts will do this automatically if you enable

    the option of OpenType fractions. But I see you know who.

  • Character styles more roll styles of hyperlink text

    It took me a while to understand this. I couldn't have my hyperlink styles to work. Just as an experiment, I've changed the text to none in the character style (I use it styles throughout the site) and my hyperlink styles work properly. I think maybe it would be useful to know that a lot of people seems to post about hyperlinks in text doesn't work does not correctly

    Thanks for posting this Marcy. This problem is a bug known, that our team of engineers is connected.

    To work around the problem, you can select hyperlinks in your text, and remove the applied character style (i.e., change the style of character 'None').

    Best regards

    Corey

  • I'm looking for links Hypertext in find/replace the dialogue (without applying a character style).

    I have 7000 hyperlinks in my document, with different character styles ("italic", "bold" and "italic +"BOLD""). I need to apply the blue color to each of them. If I ask a new character style "hyperlink" to all, I'll lose my formatting.

    Is there a way to find hyperlinks (for themselves, not their format) dialog find/replace in order to create and apply 4 different character styles ('hyperlink_regular', 'hyperlink_bold', 'hyperlink_italic' and ' hyperlink_bold + italic")?

    Sorry for my English, thanks for the help!

    Use Javascript!

    You can use this Javascript, for example. (Instructions on how to use a JavaScript in InDesign can be found elsewhere).

    blue = app.activeDocument.swatches.item("Blue");
    for (a=0; a
    

    Take care to provide the correct color swatch name in the first line.

  • How to apply a character Style that has already been made in a document model?

    First of all, I would like to thank everyone who helps. I am a complete newbie to the script and appreciate your help.

    I mainly use GREP expressions to search for patterns in a document and apply a character Style that has already been done. This character style did not help script, but just in InDesign when the production and implementation of the model.

    var myDoc = app.activeDocument;
    
    
    //Clear the find/change grep preferences.
    app.findGrepPreferences = NothingEnum.nothing;
    app.changeGrepPreferences = NothingEnum.nothing;
    
    //Set the find options.
    app.findChangeGrepOptions.includeFootnotes = false;
    app.findChangeGrepOptions.includeHiddenLayers = false;
    app.findChangeGrepOptions.includeLockedLayersForFind = false;
    app.findChangeGrepOptions.includeLockedStoriesForFind = false;
    app.findChangeGrepOptions.includeMasterPages = false;
    
    //GREP Expression for finding all HEADERS
    app.findGrepPreferences.findWhat = ".+\n";
    
    //Applying formatting changes to put into All Caps, Bold and changing the font size to 12 pt.
    app.changeGrepPreferences.capitalization = Capitalization.allCaps;
    app.changeGrepPreferences.fontStyle = "Bold";
    app.changeGrepPreferences.pointSize = "12";
    myDoc.changeGrep();
    
    //Clear the find/change preferences after the search.
    app.findGrepPreferences = NothingEnum.nothing;
    app.changeGrepPreferences = NothingEnum.nothing;
    

    This is how I currently. I will manually define the changes made to the text. The problem is, each model uses a different set of fonts and not all use them "BOLD", for example Sabon can use THIS "BOLD".

    I would like to know how to apply a character Style and tried to look, but nothing seems to work.

    Any help would be appreciated.

    Thank you.

    app.changeGrepPreferences.appliedCharacterStyle = "A";

Maybe you are looking for

  • Moving iPhoto/photo library

    Hello I'm moving my iPhoto and photo library to an external hard drive to save space on my MacBook Pro SSD. Once I located in my home folder, then the folder images, both iPhoto and photo libraries are there, and they say they have a capacity of appr

  • Need driver USB 3.0 for my Satellite L755-1J9

    I'm from the Spain and after doing format C: in my Satellite L755-1J9, I can't install the driver USB 3.0 instead of Toshiba drivers download in this Web page. Someone who has this driver can help me please?

  • smart photo Media does not

    smart photo Media does not

  • New Solid State Drive

    I just updated my computer with a new motherboard and CPU and I have added a 250GByte SSD to the mix.  Windows 7 Home Premium (64) moved very well and the system is installed and running BUT the new 250 GByte SSD does not appear in the display of 'Co

  • Built-in software TC account

    Hi all I know there's two accounts connection integrated software from transport CANADA, they are 'admin' and 'root '. Y at - it account integrated on this software? Best regards Kotaro Hashimoto