How do I apply a specific character style to specific text?

Long-time Photoshop and Illustrator user. New to Indesign.
Fortunately, this isn't an issue of how to go about creating fractions. I've already chosen a route for that. I'm simply applying a Character Style that checks the opentype "fractions" box.
Here's an example of the content I'm dealing with:
Above is my styled table in Indesign, after pasting in data I'm being given data in excel spreadsheets.
How might I quickly apply my "ptable_BODY FRACTIONS" style to only certain text, like: "1/2"  +  "1/4"  +  "1/8"  & preferably random arbitrary fractions like "34/69"?
GREP can do some great things, but can it selectively apply character styles?
This might be a job for a paragraph style. I'm not sure.  . .

@ John
That's exactly what the GREP Styles feature does. Arriving at a GREP expression that accurately targets your fractions may be another matter considering your screen shot shows your content to have no space between whole numbers and fractions.
Right. It keeps including the whole number preceding the fraction.
I'm dead set on there not being a space between the whole number and fraction, too.
I'm trying to figure out how to tell Indesign to take all fractions and give them opentype fractions settings.
I'll only be dealing with standard fractions I'm hoping, so arbitrary fractions shouldn't be necessary.
Just halves, quarters, eighths, and sixteenths should be ok. These are likely the only fractions I'll ever need to deal with: 1/2, 1/4, 3/4, 1/8, 3/8, 5/8, 7/8, 1/16, 3/16, 5/16, 7/16, 9/16, 11/16, 13/16, 15/16.

Similar Messages

  • Search for string in paragraph and apply a new character style?

    I'm searching for a way to find a specific string in a specific text frame and make it bold. so my thought was to search and then apply a character style from my template doc. I thought this would work, but I went wrong somewhere.
    newDoc is my document. 
    //something like
    var Bios = "Representative Biography:\r want to leave this text normal.";
    var myTextFrameBios = newDoc.pages.item(i).textFrames.add({geometricBounds:[4.5277, 2.36, 8.625, 5.375], contents:Bios});
    var myTextObjectBios = myTextFrameBios.parentStory.texts.item(0);
    // IS THIS CONFLICTING with my change below? Can I apply a character style within a par styled frame?
    myTextObjectBios.appliedParagraphStyle = newDoc.paragraphStyles.item("CompanyProfile");
                                                      //Clear the find/change preferences.
                                                    app.findGrepPreferences = NothingEnum.nothing;
                                                    app.changeGrepPreferences = NothingEnum.nothing;
                                                    app.findTextPreferences.findWhat = "Representative Biography:";
                                                    app.changeTextPreferences.changeTo = "Representative Biography:";
                                                    app.findGrepPreferences.appliedCharacterStyle = newDoc.characterStyles.item("BoldBioHead");
                                                    // Perform the operation
                                                    app.documents.item(0).changeGrep();
                                                    app.findGrepPreferences = NothingEnum.nothing;
                                                    app.changeGrepPreferences = NothingEnum.nothing;

    @caseyctg – If you want to apply a character style to a text object in a specific text frame, you could restrict the scope of your script to that specific text frame:
    Example with the variable "myTextFrame" you have to define before:
    myTextFrame.changeText();
    Btw.: you are doing a text search and clearing your GREP find/change preferences at the start of the snippet? Why is that?
    You could do a:
    app.changeTextPreferences = app.findTextPreferences = NothingEnum.nothing;
    or:
    app.changeTextPreferences = app.findTextPreferences = null;
    set before the search and after the change, if you want to be on the safe side…
    Uwe

  • [JS InDesign CS3] Style groups, begone! (or: How do I take paragraph and character styles out of style groups?)

    Sorry for this question (and my terrible English, by the way), I'm a javascript noob and I know when I've reached my limits.
    Well, I'm trying to take a set of paragraph and character styles out of the style groups they are placed in, in hundreds of InDesign documents (that cannot be treated as a book). As far as I've tried (thanks to the invaluable help of previous posts in this forum) I've been able to move a style into a group and change it's position inside the group, inside the root level or even between groups. But it doesn't matter how I try, I don't know which move reference should I try in case I want to take every style out of their style group and place them after their original group folder, at the [Root] style level .
    I have tried:
    var doc=app.activeDocument;
    var pGroups=doc.paragraphStyleGroups;
    for (i=pGroups.length-1; i>=0; i--){
         var pStylesInGroup=pGroups[i].paragraphStyles;
         for (j=pStylesInGroup.length-1; j>=0; j--){
    // Here I am, trying to move a style outside the folder that contains it, and failing miserably.
              pStylesInGroup[j].move (LocationOptions.after, pGroups[i]);
    It didn't work, the script sent an invalid parameter value in the reference field, so I cant use the group folder itself as reference.
    Tried other (obviously wrong) solutions, like use the first available style as reference. Therefore, my second script was
    var doc=app.activeDocument;
    var pStyles=doc.allParagraphStyles;
    var pGroups=doc.paragraphStyleGroups;
    for (i=pGroups.length-1; i>=0; i--){
         var pStylesInGroup=pGroups[i].paragraphStyles;
         for (j=pStylesInGroup.length-1; j>=0; j--){
    // Now I try placing the styles after the [Basic Paragraph], that is, the second paragraph style in the document style list
              pStylesInGroup[j].move (LocationOptions.after, pStyles[1]);
    It didn't work either, another invalid parameter in the reference field. Similar results with my other attempts (I even tried "[Root]" as literal with similar luck).
    So, my question is: Which command (or script, in case my whole approach is utterly wrong) should I use to achieve my goal?
    Thanks in advance to whoever decides to spend more than a minute thinking about my humble worries, and my apologies for shamelessly ripping some of your lines of code for my purposes.

    Okay, tried a few things and got really weird results!
    1. You can move a style around inside its group.
    2. You can move a style out of a group "to" another, but it will appear 'inside' that style. I got my test style as a sub-item of [Basic Paragraph], using index #1. With index #0 ([No Paragraph Style]) InDesign crashed.
    3. You can duplicate the style, but then you get a copy in the same group. Still no luck.
    4. Finally! What is the parent of a paragraph style?
    Document | Application | ParagraphStyleGroup
    "Application" is easy -- that's when you make a style global. So what's the difference between 'Document' and 'paragraphStyleGroup'? Simple -- well, when you finally get it...
    pStylesInGroup[j].move (LocationOptions.AT_END, doc);
    moves the style out of the group and to the end of the list in the document. I don't think it's possible to move it directly to a specific position into the main style list -- you first have to move it out of a group, then move it around in its own list.
    Fortunately, it returns its new position as a ParagraphStyle again, so if needed, you can use
    newStyle = pStylesInGroup[j].move (LocationOptions.AT_END, doc);
    newStyle.move (LocationOptions.AFTER, pStyles[1]);
    -- I didn't really try that out, but it should work.

  • InDesign erroneously applies character style to imported text

    For a year, I had been importing text into InDesign with little trouble until this problem starting happening and I can't figure out why.
    Let's say I have a CS3 file with defined character and paragraph styles.
    If I draw an empty text box, InDesign shows the character style "superscript" and paragraph style "ext_all" are applied. I can select "Break Link to Style," but if I import text into that box, the "superscript" character style is applied.
    The following happens whether I create a text box first or not:
    If I import a styled Word file, all the text comes in styled "superscript" until it reaches a Word character style.
    If I import an InDesign Tagged Text file, all the text comes in styled "superscript" until it reaches a character tag.
    If I import a very simple one sentence rtf file, all the text is styled "superscript."
    Anyone run into this? I've tried googling, but can't find a discussion about it. Thanks in advance!

    Perhaps you've inadvertently set those styles as the defaults? That would happen if you click on them with nothing selected. For the current document switch to the text tool and make sure there is no cursor active or text frame selected, then check to see that the character style is set to [None] and the paragraph style to what you would like to be your default. Also check the settings in the character and paragraph panels.
    To make sure this doesn't carry forward into any more new documents, if indeed that was the problem, close all documents and repeat the above steps. With no documents open your selections will become the defaults for all new work until changed.
    Peter

  • Niceties of apply the [None] character style and its relation to Break link to Character Style (CS4 upwards)

    Hi,
    Am I the last to realise that, with text selected, clicking on is
    different from right-clicking on and selecting "Apply " in
    the character palette?
    Let me explain: Say you have some text selected. The text has a
    character style applied called "Superscript", whose only attribute is to
    apply superscript.
    Now, with that text selected, if you click on the result is that
    is applied and all formatting is lost.
    But, if you right-click on and choose "Apply " from the
    context menu, is applied but formatting is NOT list. Effectively
    this is the equivalent of choosing "Break link to style" in the flyout
    menu of the character palette.
    Curious to know if you've come across that that distinction before?
    Thanks,
    Ariel

    Sorry Peter. On behalf of the stupid Jive forums, I do apologize. Everywhere in my post where I wrote [None], it was jived up a little and changed to a link. (I've only got Internet access during breaks -- a self-imposed firewall that allows me to actually get some work done.)
    The post shoudl have read:
    Hi,
    Am I the last to realise that, with text selected, clicking on [None] is different from right-clicking on [None] and selecting "Apply [None]" in the character palette?
    Let me explain: Say you have some text selected. The text has a character style applied called "Superscript", whose only attribute is to apply superscript.
    Now, with that text selected, if you click on [None] the result is that [None] is applied and all formatting is lost.
    But, if you right-click on [None] and choose "Apply [None]" from the context menu, [None] is applied but formatting is NOT list. Effectively this is the equivalent of choosing "Break link to style" in the flyout menu of the character palette.
    Curious to know if you've come across that that distinction before?
    Thanks,
    Ariel

  • How to spot color in a character style?

    Dear all,
    How do I use change default color in a character style to a spot color say "Red"?
    Thanks,
    Billy

    Hi
    Sorry that I didn't make myself understood. Below are the details for your information:
    We're running the XML-first workflow under InDesign CS4. When importing the XML file (with many paragraph/character styles [pstyle & cstyle]) into the pre-defined InDesign template, we find difficulties in recognizing whether there are any new paragraph/character styles that have not been defined in the existing InDesign template. It would be great if the non-defined styles could be shown in a special (spot) color, or placed into a new group. Would you please check the feasibility and advise us?
    Billy

  • How do I make no a character style color

    I gave a red color to a character style
    That you get a script
    Click I get no color
    Click again when I get back to the original color
    is it possible

    Your current code in main_pkg wouldn't throw a NO_DATA_FOUND exception. Looks like you just want to check if any row exist in the table. You don't need to use cursors for that.
    Modify your main_pkg so that it can have only the SELECT statement, OR you can just eliminate the package in this case, and move your select statement to the calling program.

  • Cross references not picking up character styles in source text

    I'm getting some annoying odd behaviour with cross references in Frame 12.
    I have some tables, where the paragraph style in the cell is called "Cell Body" (nothing odd there).
    Quite a few of the cells only have one word in them, and that word is set to courier font with a character style (called "Code").
    Then, elsewhere in the document, I am referring to this text using cross references. I am referencing the paragraph style Cell Body, and the cross reference format applied is like this "<hyperlink><$paratext><Default ¶ Font>"
    "hyperlink" is another character style that makes the text go green.
    So, the cross reference out to take the text from the cell (in Courier) and reproduce it, coloured green.
    However for about half of these cross references, it isn't picking up the Code character style in the source text, so the cross ref is just green, no green courier.
    Things are further bamboozled when I output to HTML Help.
    In the CHM file, the cross refs which appear to work OK (green courier) are now just courier.
    The ones which failed to pick up the courier look the same as they do in Frame (just green).
    Any ideas as to what's going on?
    I've tried troubleshooting by clearing the cells, reapplying the para style and default character style, then reapplying the code character style, then replacing the cross reference - which sometimes seemed to fix it but didn't always.

    Arnis Gubins wrote:
    Using two character tags in-line together (a la <hyperlink><Code>) is asking for trouble. IIRC, FM doesn't re-apply these in order on an update and depending upon how they are defined (and what is set to AsIs), the outer one usually wins. .
    So why does the blimmin' dialog invite me to do precisely that, by providing me with a list of all the character styles I have, and allowing me to select as many of them as I like??? /sulks/   Indeed, if Frame still shipped with a printed user guide instead of  stupid "optimised for viewing on iPhones" online webhelp nonsense, I suspect I might very well be able to find an example in the manual of using multiple character styles in that dialog!  If it doesn't want you to use more than one, why doesn't it grey out after you add the first one? /sighs/  The concept is called "cascading styles", it's a fundamental web paradigm! And it works in the main body text - why not in Xrefs!
    Also, I have been very scrupulous to keep my character styles orthogonal so none of their AsIs's mash each other up.
    But, rant over, I shall follow your splendid suggestion for a "Code Hyperlink" style.
    Arnis Gubins wrote:
    Also, x-ref formatting may behave differently in the new Publishing modules depending upon ....
    ...Depending on how badly designed and buggy this new Frame12 feature is, I should say!   The Publish module should not randomly stop behaving in a WYSIWIG manner in completely undocumented fashion just because Adobe couldn't be bothered to code it properly.  /sighs/
    Frankly, for my current project, I've given up trying to jump through hoops for Publish - I'm concentrating on getting the Frame source right and assuming these quirks will be fixed in Frame 13 (or 14, depending on how superstitious they are). Because if I put in ad hoc workarounds for them in Frame 12, I (or a colleague) will only have to undo them later when they're fixed, and by then we'll all have forgotten what the original problem was.

  • Conditional build tags with character styles and ignored text

    RoboHelp HTML v8.0.2.208
    Windows XP Professional Version 2002 Service Pack 3 with 2 GB of RAM
    Output: WebHelp and HTML Help
    I have recently moved my projects from RH HTML X5 to RH HTML 8 and this is when the following problem appeared. I use lots of conditional build tags within the help projects. Some of these tags are for my own use for reference and I combine these with character styles containing a coloured background (highlight) so that they show up in the WebHelp or HTML Help output (e.g. text to identify the software version that the field/feature/text was added, reminders to check details, insertion of bug ID numbers, design document names, etc.). These areas of text are stripped out of the final build for customers by using a conditional build expression.
    What I have noticed is that if a paragraph contains text with a conditional build tag applied AND that tagged text has a character style applied AND an unknown word within the conditional build tag is ignored (with the HTML tag <?rh-ignored text="word_to_be_ignored" ?>), saving the topic, closing it, then re-opening it shows that the conditional build text has stretched to the next conditional build tag, or to the end of the topic if there aren’t any other conditional build tags. This also happens by switching from Design View to HTML View. Note that this doesn’t happen if Ignore All is applied to the unknown word.
    This doesn’t just apply to projects converted from RH X5. I created a new test project in RH8 and the same behaviour was observed. Similar behaviour occurred very occasionally in RH X5 but that seemed to be down to HTML tags being nested incorrectly.
    The largest project contains around 1200 topics and with many hundreds of conditional build text areas this now causes a problem. I’ll probably have to locate every ignored word in an area of conditional text within each project, set it to Ignore All and then manually remove and re-apply the conditional build tags, unless someone can come up with something clever. Can anyone else replicate this and should it be logged as a bug?

    Hi Daggins,
    Thanks - that is good info to have. But as we all agree, that does take away from the point of single-sourcing.
    You aren't misunderstsanding exactly... I am doing all my conditional tagging in FM and it works like a charm in terms of the PDFs that I generate from FM, and even the conditionally tagged text in RH shows/hides correctly. The issue is I am also importing my index and TOC from FM... and even if I have an entire file in FM tagged as conditional (all the text is tagged as conditional, I don't know if you can tag a file as conditional), the file name as a heading it still appears in the RH TOC. There is no text... but in my view it shouldn't appear in the TOC either (it looks like just a broken link when I generate my online help) - this is not ideal.

  • Character styles over ride text hyperlink styles

    It took me a while to figure this out. I could not get my hyperlink styles to work. Just as an experiment I changed the text to none in the character style (I am using it styles on the entire site) and my hyperlink styles were working correctly. I think perhaps this would be helpful to know as many people seem to post about text hyperlinks not working properly

    Thanks for posting this Marcy. This behavior is a known bug our engineering team has logged.
    To workaround the problem you can select the hyperlinks within your text and remove the character style applied (i.e., change the character style to "none").
    Best regards,
    Corey

  • How do I surface language specific texts in Integrated ITS?

    Hello all,
    I'm new to both stand alone and integrated ITS and am researching the upgrade process. In our stand alone templates we used htrc files with our html templates to show language specific texts.
    Example.
    html template code for a field label
    `if (i==2) DETAIL-FLABEL[2]= #KAFN end`
    htrc name value pair
    z_pz01_en.htrc
    KAFN     Known As First Name
    z_pz01_de.htrc
    KAFN     Bekannt unter dem Vornamen
    I see no hint that htrc's can be used in integrated and am not seeing anything in the way of resource based language texts in integrated. I think I've hit every document out there yet, I have a feeling I'm missing something obvious. Your help is appreciated.
    Doug

    Edgar,
    Thanks so much for the detail!
    I have run through the steps for manual creation of translations as well as SIAC_UPLOAD of htrc files and have it working and documented. I will add a few more findings here for others who find this post later.
    Some of our old htrc files had duplicate keys (probably from original German version). In stand alone ITS the last key in the file was used so this didn't matter. In integrated ITS this matters for 2 reasons.
    1 Uploading/Converting htrc files having logged in in English will cause failures if any of the text being entered in the service parameters has characters that arent consistent with the codepage being used for EN. (Ex. back Azureück). Clean up htrc files to use only the language they should contain.
    2 Stand alone ITS was forgiving of htrc files containing duplicate keys. Integrated ITS is not. Remove all duplicate keys.
    3. This one is obvious but... if  parameters have already been entered in another language you may be prompted to confirm you are changing language and there are several prompts along the way. As these prompts will appear in the logon language itu2019s important to eitheru2026
    a. Be fluent in all supported languages , oru2026
    b. Memorize button and menu positions.
    I do have one additional question.
    Our old stand alone setup had an alternate corporate "APCI" design that we used...
    File system view -
    hostDEV_WWWmimesdesigns"apci"webgui as opposed to the out of box
    hostDEV_WWWmimesdesignssap_streamlinewebgui I suppose.
    I believe this was then referenced in the global services file ~DESIGN="APCI"
    I'm starting research to understand if there is an analog to this in the integrated webgui service or precisely what I have to do to accomplish alternate styles for webgui and our Z_services.
    Thanks again, points on the way, If I could award more I would.
    Doug

  • How to bold/italics/underline specific text (not default) in Calendar Ver 7?

    See above.  I've already tried Ctrl+ U/I/B and Command + U/I/B
    The app = Calendar Version 7.0 (1835.1) in Mac OS X. 
    Looking to select specific text in the Notes/Attachments/URL portion of the appointment and mark it up.  We can do this right?  MS Office can, so surely... 
    Thanks so much! 
    Randoramma

    Why haven't I read about this problem elsewhere?  Help!
    Probably because it's not an issue for others.
    I have lost the ability to select italics in both Pages and Text Edit.
    Can you try a few different fonts and see if this happens?
    Some fonts don't have an italic style (eg Marker Felt, Papyrus) where other fonts are more complete and have an actual font specifically for italic (eg Helvetica, Gill Sans). Some programs work around this by faking an italic font. Pages and TextEdit not fake an italic font and only let you choose italic if the font provides it.

  • How do I apply a specific background color in InDesign?

    The background color is identified in Ps as "edf7e4", and it is a very pale green.  How do I make this the background color for my book cover in InDesign?

    You must add a frame to your cover page(s) at the bottom of the stack and fill it with the color that you wish to use (you can keep the RGB definiton and convert on export, too, if you need CMYK for press). Don't forget to bleed the edges where required.

  • How can I see where Paragraph / Character Styles are used?

    I am editing a 40-page document and have many Paragraph styles. I have already deleted unused paragraph styles and now would like to see where are the remaining styles used to edit the text directly. IS there a way to see it? (InDesign CS4 or CS5)
    Thanks,
    Marina

    Marine von Koenig wrote:
    I am editing a 40-page document and have many Paragraph styles. I have already deleted unused paragraph styles and now would like to see where are the remaining styles used to edit the text directly. IS there a way to see it? (InDesign CS4 or CS5)
    Thanks,
    Marina
    Save two copies of the file.
    Close the original file. In a saved copy, [EDIT] use the paragraph style panel to [/EDIT] change the text color of every paragraph style to a new color whose swatch you name for the paragraph style. For example, Head1 paragraph style's text color becomes your newly-made swatch Head1color.
    Every paragraph in the document will appear in the color you assigned. This should give you a picture of which paragraphs are which style.
    Save the colored version of the file if you want to keep it.
    HTH
    Regards,
    Peter
    Peter Gold
    KnowHow ProServices
    Message was edited by: peter at knowhowpro

  • How do I change the default paragraph style from Body Text?

    The default paragraph style in my email setup is Body Text. This does not wrap properly for some recipients, but Paragraph does. How do I change the default so that Paragraph is automatically used when I start a new email?

    There are two types of defaults: defaults for all new documents and defaults for the current document. To change the default for any open document make sure no text frame is active and change the formatting as desired in either the Control panel or the Character and Paragraph panels. To change default formatting for new document (those not yet created) do this while no file is open. You can’t change the defaults for several documents at once without a script.

Maybe you are looking for

  • Empty cache but save passwords

    how do i empty cache while saving my passwords? thx Deb

  • How to fix ipod nano 6th edition when water damage?

    Well this is my story. I was cleaning my room and I put my ipod in my sweater.Later in the day I went to take a shower I put my sweater in the laundry basket.My dad was washing sweaters so he told me to give it to him so I did. I went to my room and

  • Any fix on home key and search key not working?

    I got this phone about a month ago but never had time to really learn it until now and so far I am not impressed. Should have stayed with HTC and too late to change. My home key and search key do not work. I have tried a reset and nothing. Anyone hav

  • Sending SOAP Attachments through BPEL--Urgent

    Hi All, we are calling one external web service from bpel.webservice expecting 2 attachments as part of request. here is the sample soap request. *<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:imp="http://www.agile

  • Music Manager - Not Recognising Album/Artist

    Hi All, This seems to be a bit of a **bleep** - Music Manager is not recognising my Track/Album/Artist titles when I import my music files. I keep all my tunes in iTunes. Now, I think probably 90% or above of the world population use iTunes to manage