Automate character styles?

Tuesday morning, I have to sit down and pop hundred and fifty summer events into a flyer. Choice A is easy - I can print them and type them. In the shower, though, I began thinking about Choice B, and I don't know whether InDesign can do what I want.
I have control over the database where they're hosted, and it's pretty easy for me to pop them out in the format
~~~~~~~~~~~~~~~~~~~~~~~~~~
Date - Time  [carriage return]
Event name
~~~~~~~~~~~~~
Date - Time  [carriage return]
Event name
~~~~~~~~~~~~~
Date - Time  [carriage return]
Event name
~~~~~~~~~~~~~
which is all the information I need on this document. On the finished product, though, I want Date and Time to have character styles applied (for color and weight). It's not that hard for me to assign hot keys to Character styles and do this by hand - just twenty minutes of tedium.
But!
Could I format this as
(where the symbols are just unique symbols)
~~~~~~~~~~~~~
ªDate - ∞ £ Time ¡ [carriage return]
Event name
~~~~~~~~~~~~~
and then use a Find/Replace function to tell InDesign
-  in the case of "  ª . . . ∞  ", apply character style "Date style"
-  in the case of "  £ . . . ¡ ", apply character style "Time style"
and then go through and delete all instances of ª, ∞, £ and ¡
(Extra spaces applied for ease of reading)
Or, if I'm imagining this wrong, is there another way I can format the original data to automate the application of styles?

I don't even think you'd need grep for this.
I'd create two paragraph styles, one for date/time with the next style being event name and event name with the next style being date/time.
Then create a character style for time and have the base paragraph style for date/time being the formatting you want just for date.
The date time style would have nested style with none through the hyphen and time through the end of the paragraph.
Place the text and then select all of it and in the paragraph styles panel right click date/time and from the contextual menu choose apply date/time and next.
That should fully format all of your text.
Bob

Similar Messages

  • JS:CS3 Newbie needs help! find/change character styles

    I'm new to scripting and JavaScript is giving me a headache, but I'll keep trying. What I'm trying to do is automate a few things so that the production time of our school newspaper is reduced while insuring accuracy.
    I've played around a little with the text find change sample and the changing or adding paragraph styles in the InDesignCS3_ScriptingGuide_JS.pdf and I barely understand what I'm doing.
    When us page designers receive text to place in the document, our editors mark the text with tags like: < b >text< / b >, where the word "text" is to be bolded. (there wouldn't any spaces between < and b and > etc. I just did that so It'll show up here). We have basic character styles and paragraph styles set up, and we just started working with nested styles.
    Is there a way we can search for the < b > tag and bold everything after it up until the < / b > tag? Sort of the way it does for html (the way it would do for this message if I took out the spaces). It'll be great if it could remove the tags as well, but if not, I know I could create a find/change script to do the removal afterwards.
    I appreciate any input.
    Thanks!

    You've not found yourself the easiest of tasks! You need GREP find/replace, not text. Do you have any experience with GREP? It's worth investigating, it's a powerful feature. The script below handles bold. For clarity, it doesn't do any error checking: it assumes that there's a document with text in it and that the document contains a character style called 'bold'.
    // talk to Indesign, nobody else
    #target indesign
    // reset the Find/Change dialog
    app.findGrepPreferences = app.changeGrepPreferences = null;
    // find everything between <b> and  (including these codes)
    app.findGrepPreferences.findWhat = '<b>.+?</b>';
    // add 'bold' style
    app.changeGrepPreferences.appliedCharacterStyle = 'bold';
    // make the changes
    app.activeDocument.changeGrep();
    // now delete the <b> and </b> codes
    app.findGrepPreferences = app.changeGrepPreferences = null;
    app.findGrepPreferences.findWhat = '</?b>';
    app.changeGrep();
    You can adapt it easily to handle other codes, and at a later stage you could generalise it so that you needn't repeat whole bunches of code.
    Good luck with your first forays. Again, it's not the easiest of tasks, but it's worth getting to grips with.
    Peter

  • Table of contents from lists or character styles

    I have a legal document and I want to create a table of contents that includes, not just Headings (Article I, II, III, etc.) but also the sub headings (eg: Artilcle IV.3) which were created as numbered lists.  If I give the list item a paragraph style it will put the whole text into the TOC.  If I put a carrige return after a List heading it makes the body text as a new number in the list.  Is there some wat to get either lists or character styles into the TOC? Can you have an in-line paragraph style? Here's what the document looks like:
    Article VII Heading
    List Heading.  body text...
    a)   Sublist heading body text
    b)   Sublist heading body text
    List Heading.  body text...
    Is there any way to do this so that the TOC reads something like this:
    Article I   Heading              ....... page 2
              2. List Heading          ....... page 2
                a) Sublist Heading   ....... page 2
                b) Sublist Heading   ....... page 2
              3. List Heading          ....... page 3
    Article II                              ....... page 3
    etc. ??
    I could do this manually, but this is document is being edited now and again and I don't want to have to change the TOC everytime we make a small chage to the document.
    Thanks,
    Brendan

    The numbering and lettering are automatically generated by the List I selected.
    It's been a few months since I did this, so I'm trying to remember exactly how the process went.
    I've edited Bylaws and Constitutions like this several times for several non-profit organizations over the years, first on MS-DOS with floppy-discs using WordPerfect, later Windows and MS-Word, and now Mac OS-X and Pages '09. With each new iteration of software it keeps getting less painful, but it's still not a piece of cake.
    This time, I began with scanned images of the last printed original copy (2008) for a document that no longer existed in any original computer format (1994). I imported the scans into Optical Character Recognition software included with my Canon printer/scanner.
    I was determined NOT to re-type the whole document from scratch, so the editing I describe WAS time-consuming and a bit tedious, but still a bit less painful that starting from scratch. I'm a volunteer and retired. A paid fast(er) touch-typist working in an office (and their supervisor) might strongly disagree!
    After cleaning up a few OCR-generated typos, I was also determined not to manually re-create the outline format and the table of contents if at all possible. Even 1980's WordPerfect on floppy discs could automatically generate an outline and a table of contents from marked text!
    I used Lists to generate the desired outline format similar to the original, in some cases, correcting errors, but as shown in the above example, there are a few A's without B's and so on, because the original document (1994) was formatted that way, and I didn't want to substantially re-write the Bylaws at this time. (Save that for another day!)
    As I edited, with the printed original by my computer, I did delete the original outline I's, A's, 1's a's, and so on as I went through, letting List do the re-numbering, and using Style to format the newly numbered headings.
    Simple shortcuts when auto-generating lists: a [Tab] moves the active heading to the next-lower designation, and [Shift]+[Tab] moves it to the next-higher designation. Occasionally, I have to just use [Delete] to back up over the suggested letter, and start over again with [Return] to force the next letter/number.
    And opening Inspector, Text, Lists, as shown in the example above, might help you more easily 'control' the outcome, as does Inspector, Document, TOC, noted earlier.
    Hope this helps!

  • Why won't Numbers save my character styles shortcuts?

    I like to keep all my character styles shortcuts thru all my projects yet Numbers won't save them thru restarts or quits but it used to. Any help appreciated

    * Make sure that you not run Firefox in (permanent) [[Private Browsing]] mode.
    * You enter Private Browsing mode if you select: Tools > Options > Privacy > History: Firefox will: "Never Remember History"
    * To see all History and Cookie settings, choose: Tools > Options > Privacy, choose the setting <b>Firefox will: Use custom settings for history</b>
    * Uncheck: [ ] "Automatically start Firefox in a private browsing session"

  • Generating TOC with Character Styles Referenced

    I have a paragraph style applied so several paragraphs in a document.  This paragraph style has a nested style for the first few words of the paragraph which also have a specific character style assigned to them.  The thing is that I need to be able to reference or list these first few in my TOC.  I'm aware that the automatically generated TOC doesn't have the ability to refrence character styles, but I'm hoping that someone else knows of a way around this.  Does anyone know how to work around that or include, somehow, character styles in the TOC list?  The main reason I'm needing to do this is because the automaticly generated TOC (Layout > Table of Content) is built in such a way that it can be recognized in the settings when exporting to epub.

    It was a good idea and almost worked.  I created an extra textbox with the text I wanted included in that text box with a specific paragraph style applied to it that has non-printing text.  Once I included the paragraph style in the Automatically generated TOC it worked in generating the text in the TOC line up, but when I exported the file to an EPUB there was no way to tell it not to include the text that where non-printing.  Therefore the words/sentences that were not visible in indesign or on print and anchored to the original text were doubled in the final epub version.

  • Can you create a ToC with nested character styles?

    I'm creating a technical guide document, and for ease of formatting within document creation I've used nesting character styles within the 'Body' paragraph style. I need to reference the second level headings within the ToC, but I since I can only use the 'Paragraph' styles in ToC creation - can I do this? (I'm using InDesign CC)
    The document looks something like this, with the italics indicating the nesting structure and the ** indicating what needs to go in ToC.
    1. Our Story (separate paragraph style, not an issue)
    1.1 Random Title Goes Here ("Body" paragraph style, nested "Heading 2")**
    Body text now, all over here, several paragraphs, etc. ("Body" paragraph style, nested "Body")
    Subheadings - not required in ToC ("Body paragraph style," nested "Subheading")
    1.2 Random Section Title goes here ("Body" paragraph style, nested "Heading 2")**
    More body text, you get the gist. ("Body paragraph style, nested "Body")
    Basically, I need to build my ToC with the Heading 1 and the Heading 2, but Heading 2 is nested in "Body" paragraph style.

    Nested styles are NOT a TOC style function, it is only available in a paragraph style. But when you choose a paragraph style to be written into your TOC based on another Para Style, most likely a headline, you can define such nested styles in this para style.
    But a TOC entry can only include a complete paragraph, a single one. You can make a Para Style, let's name it TOC1 which draws the information from Headline 1, but not for headline 2.
    This TOC1 can include nested styles (or GREP styles).
    Another way to define chara styles automatically is via the TOC style definition. Styles there will override any styles which come from nested and GREP styles. (But this does not necessary mean, that they have no functionality any more, because ID's styles are only partially defined and leave room for other elements of a style to be used together.)

  • Unused paragraphs and character styles in the catalogs?

    How could I delete automatically the unused paragraphs and character styles from the catalogs?

    David,
    I downloaded it and placed the file in my plug-in folder, but it doesn't show up under File>Utilities. Is there anything else I should do?
    I am running FM9 with all updates.
    Thanks,
    ls

  • GREP question re: character style

    I am trying to take a block of text and change everything in that text to a certain character style. What's the correct GREP expression to do that? I know I could just highligh the text in question and apply the character style, but I need to use this in a FindChangeByList script, so I need to do it using GREP expressions. Thanks.

    What I'm really looking for is this. When I want to format a paragraph in a paragraph style, sometimes there are underlying character styles that I need to clear first. So I higlight the block of text, go to character styles and select [None], thus clearing that text of any character styles. Then I apply my paragraph style. I've found that if I don't do this, I get unexpected results.
    I know that the active characer styles is always the last character style that was used, but I wish that the default was simply the [None] character style. I'm forever having to go back to [None.]
    I'm trying to build some scripts that automate this for me, but perhaps there's a much easier way to think about this problem.
    Message was edited by: JoJo Jenkins

  • Working with Character Styles in Photoshop CC

    Hi,
    I upgraded to Photoshop CC and was quite excited about the Character Styles Panel. But now, I'm completely puzzled.
    It almost looks like Adobe didn't finish the feature before shipping 14.1.2
    1. I can't reorder the character list? Why use a different list implementation than that for "Layer Comps?"
    2. I want to copy and paste a character style from one selection to another (Basically the workflow from Apple Keynote). It should be possible with character styles, but it just didn't work:
      - I select a formatted text section
       - I press "New Character Style icon"
       - I double-click the new style -> The font-size in the style differs from the font-size of the orginal selection?!
       - I'm pretty sure it has to do with style of the original text not being directly overwritten from "None", but there is no feature to "bake" style-formatting either.
    3. I can't remove and restyle the Character-Style "None". But when I accidently assign "None", it is defined as 12px Arial Black . So the default-style HAS a style definition and should therefore be editable like the other character styles.
    I'm completely blow away how non-intuitive the whole process is. I never had problems to understand character styles in InDesign, Pages, Word and Illustrator. But in Photoshop is either completely broken or non-intuitive.
    Just my two cents.
    tom

    Your sure your using photoshop cc on windows vista?
    I was under the impression that photoshop cc would not even install on windows vista.
    What version of camera raw do you have?
    In photoshop under Help>About Plugin does it list Camera Raw and if so which version is it?
    (click on the words Camera Raw to see the version)
    Camera raw doesn't work if it's a camera raw file or some other file type such as jpeg or tif?
    What camera are the camera raw files from?
    Officially camera raw 8.3 is the latest version of camera raw that will work on windows vista.

  • Paragraph styles all default to wrong character style

    So I set up a template and based all my character styles on my basic body copy. However, every new text box I create it defaults to the "character styles" to my section header color and sizing. I have to right click and "clear character styles" every single time. I've never had this happen before and cannot figure out how to fix it, it is such a PAIN!

    From your explanation, I suspect your use of Character Styles might need to be redirected to Paragraph Styles. But that is conjecture, so I apologize if I'm wrong. In any case, to solve your problem; with nothing selected, choose No Character Style in the Character Styles panel. That sets the default for new frames.

  • Why do text variables using Running Header character style translate forced returns as a word space in the running head on the first page but close up the space on subsequent pages?

    In an InDesign document that requires 3 different Chapter head paragraph styles (to cope with differrent length headings) I've set up the running heads on the master page with a text variable using the Running header (character style) option. The character style I've assigned to this is an empty character style that is applied to all 3 chapter head paragraph styles.
    Some chapter heads require a forced line break, so that the line breaks are aethesically pleasing. On the first page the text variable translates this forced line break as a word space in the running head, but on subsequent pages it ignores the forced line break. This means that if you have a word space before the forced line break, on the first page you get a double word space and on subsequent pages the running head sets correctly with a single word space. But if you remove the word space before the forced line break in the chapter head text, the first running head sets correctly with forced line break interpreted as a single word space, but on subsequest pages the space is closed up.
    This only seems to be a problem when the character style option is used for header text variables. If a paragraph style is used the forrced line break is interpreted as a a single word space in all instances, both on the foirst page and subsequent pages.
    This would appear to be a bug in how text variables are applied when using the Running header (character style) option. I can't see any other reason why the text variable would beheave differently on the first page and on subsequent pages. There is only one master page, so it isn't a case of their being an error between a main master page and a chapter opener master page.
    Does anyone have any solutionss, or know if this problem has been fixed in subsequent releases of InDesign (I'm using CS6 ID version 8.0)
    Thanks

    Ask in the ID forum...
    Mylenium

  • 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.

  • Script needed to generate a list of paragraph and character styles from the Book Level

    Hello,
    I am using FrameMaker 11 in the Adobe Technical Communication Suite 4 and I need to find a script that will generate a list
    of paragraph and character styles from the book level.
    I am working with unstructured FrameMaker books, but will soon be looking at getting a conversion table developed
    that will allow me to migrate all my data over to Dita (1.1 for now).
    Any thoughts, ideas on this is very much appreciated.
    Regards,
    Jim

    Hi Jim,
    I think the problem you are having with getting a response is that you are asking someone to write a script for you. Normally, you would have to pay someone for this, as it is something that folks do for a living.
    Nonetheless, I had a few minutes to spare, so I worked up the following script that I believe does the job. It is very slow, clunky, and totally non-elegant, but I think it works. It leverages the book error log mechanism which is built in and accessible by scripts, but is spendidly unattractive. I hope this gives you a starting point. It could be made much more beautiful, of course, but such would take lots more time.
    Russ
    ListAllFormatsInBook()
    function ListAllFormatsInBook()
        var doc, path, fmt;
        var book = app.ActiveBook;
        if(!book.ObjectValid()) book = app.FirstOpenBook;
        if(!book.ObjectValid())
            alert("No book window is active. Cannot continue.");
            return;
        CallErrorLog(book, 0, 0, "-----------------------------------------------------------");
        CallErrorLog(book, 0, 0, "** Book format report for:");
        CallErrorLog(book, 0, 0, book.Name);
        var comp = book.FirstComponentInBook;
        while(comp.ObjectValid())
            path = comp.Name;
            doc = SimpleOpen (path, false);
            if(doc.ObjectValid())
                CallErrorLog(book, 0, 0, "-----------------------------------------------------------");
                CallErrorLog(book, 0, 0, "-----------------------------------------------------------");
                CallErrorLog(book, doc, 0, "");
                CallErrorLog(book, 0, 0, "-----------------------------------------------------------");
                CallErrorLog(book, 0, 0, "-----------------------------------------------------------");
                CallErrorLog(book, 0, 0, "Paragraph formats:");
                fmt = doc.FirstPgfFmtInDoc;
                while(fmt.ObjectValid())
                    CallErrorLog(book, 0, 0, "  - " + fmt.Name);
                    fmt = fmt.NextPgfFmtInDoc;
                CallErrorLog(book, 0, 0, "-----------------------------------------------------------");
                CallErrorLog(book, 0, 0, "Character formats:");
                fmt = doc.FirstCharFmtInDoc;
                while(fmt.ObjectValid())
                    CallErrorLog(book, 0, 0, "  - " + fmt.Name);
                    fmt = fmt.NextCharFmtInDoc;
            else
                CallErrorLog(book, 0, 0, "-----------------------------------------------------------");
                CallErrorLog(book, 0, 0, "!!!  Could not open: " + comp.Name + " !!!");
                CallErrorLog(book, 0, 0, "-----------------------------------------------------------");
            comp = comp.NextComponentInBook;
    function CallErrorLog(book, doc, object, text)
        var arg;
        arg = "log ";
        if(book == null || book == 0 || !book.ObjectValid())
            arg += "-b=0 ";
        else arg += "-b=" + book.id + " ";
        if(doc == null || doc == 0 || !doc.ObjectValid())
            arg += "-d=0 ";
        else arg += "-d=" + doc.id + " ";
        if(object == null || object == 0 || !object.ObjectValid())
            arg += "-O=0 ";
        else arg += "-O=" + object.id + " ";
        arg += "--" + text;
        CallClient("BookErrorLog", arg);

  • Link Character Style to Paragraph in CS5.5?

    I have created a few different Character Styles in Indesign e.g. SM and I want all of the Character Style SM to link to it's definded abbreviation 'Site Manager' in the document.
    Is it possible to link all of that Character Style throughought the document to that part of the document, or must I create all of them individually (monotonously)?

    To anyone this may help in the near future:
    To assign a Text Anchor, select what you want to be the destination (when you click on the link is where you end up): this case Principal Contractor (PC). Window > Interactive > Hyperlinks, click top right button.
    New Hyperlink Destination, From drop-down menu select Text Anchor > Ok.
    Congratulations you've now made your Text Anchor.
    Setting up the Link:
    Now we need to select the actual link itself.
    Select whatever text you like;
    Click top-right corner;
    Insert Cross-Reference;
    Under Text Anchor: you can select what you would like to link to. As you have already defined Principal Contractor as your destination link this will do nicely (and will be your only option selectable if you only did as above);
    Under Cross-Reference Format > Drop - Down menu > Text Anchor Name: This is where you select what you wish it to be displayed as. You should create your own by clicking on the pen to the right > then the little + at bottom left corner.

  • How do I apply a character style to a sentence that has an '&' in it?

    Hi all,
    I'm trying to apply the Character style 'See Figure' to any mention of of the phrase (See Figure x) which  I've figured out is: \(See Figure \d+\)
    The problem I'm facing is that sometimes I will need to list multiple figure references. It will need to read (See Figure x&y) and in rare cases (See Figure x,y&z)
    NOTE: There are no spaces in the above listed numbers.
    Thank you  for your help.

    That works perfectly, thank you very much.
    Can you break it down for me in English if you have a moment please? I think I'm reading it wrong.
    Digit followed by an Ampersand (I'm confused by the square bracket and plus...)

Maybe you are looking for