Change paragraph style of empty row using GREP

Hello again ... another GREP query if anyone can assist!
How can I change a completely empty paragraph line (like those found between verses in a poem, for example) to a different paragraph style so I can control the space better using GREP?

Fair point ... but if I demonstrate:
Text line here
Text line here
Text line here
Text line here
Text line here
Text line here
The empty row (4) between the two blocks is in the same paragraph style as the rest of the text. Indeed if lines 3 or 5 were in different styles I could remove the empty row and create a space using before/after spacing. But it is all in the same style. I was wondering if there was a way using GREP to change the para style of an empty row ie 4.

Similar Messages

  • How can I change the style of a row in tableview?

    Hi,
    How can I change the style of a row in tableview, for example ,I have 10 items in table view, and I'd like to change row 1,4,10 background-color:red; font-family:Arial ,Font-Weight:BOLD.
    Any suggestion?

    Yes, I knew how can I change the style using cell factory. there is a lot of work to do if it has so many columns in table view. we need to implement every cell factory, Do we have a simple way to change the whole row style , just like fabsav said, I 'd like to set the special row like this line:
    tableview.getItems().get(i).setStyle("myRowstyle"); And I found a bug if I implement my functionality with cell factory way, I can't change the cell style after rendering cell.
    protected void updateItem(Object object, boolean empty) {
          super.updateItem(object, empty);
    }updateItem() was only triggered while cell is being rendering, there is no way if I'd like to change the cell style after rendering event.
    Hi fabsav, How can I apply a CSS class to a specific row? Can you please provide a short example?
    Edited by: imtoocute on Aug 28, 2012 10:31 AM

  • GREP for changing paragraph style?

    Okay folks, I have another one for all you smart people out there. I think GREP can be used to change formatting in the following instance, but I have no idea how to set it up.
    I have a very long document, essentially a phone book-type listing of names, phone numbers, addresses, well over 150 pages' worth. The paragraph styles are fairly simple, only two per listing. The name/phone number is bold with a right hand tab with leader dots to a phone number that is flush to the right side of the column. The following lines are flush left, not bold, but indented 6pts. I've placed the text file and assigned the entire thing the NameListing paragraph style. I'd like to use GREP to find the address lines and change them to the NameListingAddress paragraph style.
    Here's a screen shot to give you an idea. The left column is formatted correctly with both styles, the right column is "raw", all paragraphs formatted with the NameListing paragraph style.
    Is this an appropriate application for GREP? If so, how do I set it up to only change the paragraphs that "don't have tabs"? It would save me a crapload of time.
    THANKS again! --Dina

    If your intent here is to use the character style to trigger a variable, as I belive it is based on your other thread, you MUST apply the character style up to the first tab to pick up the text at the start of the paragraph. There are two approaches to automating the formatting after that, but it may be too late for you to be much help.
    In cases where every listing has the same number of lines it makes sense to use a unique paragraph style name (not necessarily format -- base on on another) for each lline and make it its own paragraph. Set up "next styles" to rotate through the list so each line is assigned the correct style based on the style of its predecessor. You get the rotation to sart over by making the first line style the next style for the last line. This works for manual entry and can be applied to an entire block of placed text in a single operation by selecting the text, then right-clicking the name of the first style to be applied and choose Apply <stylename>, Then Next Style.This ONLY works if you have exactly the same number of paragraphs in each listing.
    The other option is to use forced line breaks instread of paragraphs and use one style for the entire listing. Set a left indent and negative first line indent, create a character style for the part of the first line that you want to appear in your header and apply it Up To ^t^n (that's a little-known trick -- if you enter more than one character in the trigger for a nested style it will activate on the first instance of any of the characters listed that occurs, so for example if you enter the word cat, your style will end on the first, c, a or t that appears inthe paragraph. ^t is the metacharacter for tab, and ^n is for forced line break) so that the style will end at either the tab, if present, or the forced line break if there is no tab (if you use a right-indent tab instead of a regualr right aligned tab [tricky to do a leader, but that's another discussion] substitute ^y for the ^t), then add a nested Line Style for one line. That line style should use a second character style that is based on the first character style you created for the name text and has no other attributes if you want the line to be the same from end to end. Sounds more complex than it is, and will work for listings with variable lenghths. The trick is to repalce your paragraph returns with forced line breaks, and will require a little thinking.
    If using separate paragraph styles for each line, you'd use the same technique of a nested style up to a tab for the first line, but there is no need to get fancier since it will apply to the whole line if there is no tab. The paragraph style, in this case, would carry all of the bold and size formatting (and no need for any indents), and the character style would be nothing more than a name that will allow you to use it in the variable.

  • Change paragraph style from X to Y in Pages Doc

    Hi
    Sorry for such a simple question, but I have looked through the Applescript manual and searched this forum and can't find a solution to my problem.
    All I want to do is loop through the paragraphs of a Pages document and if the paragraph style is "Body Full", then change it to "Body Half". I have tried if statements repeat statements and everything I can think of but can't seem to get it to work. I can loop through all the paragraphs and change them to "Body Half", but as soon as I try to select only those whose paragraph style = "Body Full" it doesn't change any.
    Here is an example of my attempt:
    tell front document of application "Pages"
    repeat with X from 1 to count (get paragraphs)
    if paragraph style of paragraph X = "Body Full" then
    set paragraph style of paragraph X to "Body Half"
    end if
    end repeat
    end tell
    If anyone could help I would be grateful. It's kind of embarrassing since I was a programmer for many years on mainframes and AS/400. Scripting is a new world to me.
    Thanks in advance.
    Jim

    Hello
    Jim Kahler wrote:
    I am also using iWorks 09. Now the indent level sets all paragraphs to the indent level of wherever the insertion point was when I ran the script.
    ? Still confused, it looks so easy!
    Jim
    Ok, i understand.
    Here is the solution :
    tell front document of application "Pages"
    set sel to selection
    set search_style to paragraph style "Body Full"
    set new_style to paragraph style "Body Half"
    repeat with X from 1 to count paragraphs
    tell paragraph X to if its paragraph style = search_style then
    select character 1
    set Y to indent level
    set its paragraph style to new_style
    set indent level to Y
    end if
    end repeat
    select sel
    end tell

  • How to change paragraph style

    I have a text frame selected and it contains a story having various pargraph styles applied.
    I want to get name of each paragraph style applied in it and replace each with some other styles.
    But when I am applying style only one style is applied to whole text frame .(i.e all existing styles are replaced with a single style).
    Please help me , if there is any way.
    Thanks

    It was not a criticism of your design choices. You have misread my comments, I am simply warning you from long experience. We have no idea of what you do or don't know, most people who come here have little and it is safer to assume they have none.
    Creating a Textbox, which is randomly sized and placed and contains no text, is not dissimilar to having a Textbox already in the document with Placeholder text in it that you click on and it is replaced by whatever you type. If your client is quite familiar with Pages they must be familiar with using Placeholders and with duplicating and resizing objects as required. It is just a way of getting around your problem.
    Obviously you have done something else, or you would not be getting the results you have. I keep my version of Pages 5.5.3 as installed for testing, I don't know what you have done that is different and can't tell without having the file.
    If you want me to look, email me via my blue name. If not, that's fine too.
    Peter

  • [JS, CS2] Find Text - Change Paragraph Style

    I have text supplied to me formated with <g>,< b>,<k> or <r> at the start of paragraphs, this represents different paragraph styles that need to be applied. <br /><br />I started a script below, but it comes up with an error at "app.findTextPreferences.findText" <br /><br />have a used the wrong function here? <br />Is there an easy way for it to run through all of them as well, or should I just repeat this script with < b>,<k> and <r><br /><br />var myDoc = app.activeDocument;<br />var greenBullet = ["<g>", "<g>"]<br />replaceGreen();<br /><br />function replaceGreen() {<br />for (i = 0; i < greenBullet.length; i++) {<br />            var myGreenArray = greenBullet[i];<br />            app.findTextPreferences.findText = myGreenArray[0];<br />            app.changeTextPreferences.changeTo = myGreenArray[1];<br />            app.changeTextPreferences.appliedCharacterStyle=myDoc.characteerStyles.item("OFI Body copy_GREEN BULLET");<br />            myDoc.changeText();<br />            }<br />}

    Thanks Dave!<br /><br />OK, Now I am getting this message when I run it:<br /><br />"A layer with this name already exists...<br />...     if (myPageItems[i]  instanceof TextFrame && myPageItems[i].itemLayer.name = "listings")"<br /><br />So it's trying to create a new layer called listings.<br />Also - it seems to want to move the items to that layer?<br /><br />var myDoc = app.activeDocument;<br />app.findPreferences = null;<br />app.changePreferences = null; <br /><br />myObjectStyle = myDoc.objectStyles.item("defaultText");<br />myPageItems = myDoc.allPageItems;<br />for (var i = myPageItems.length - 1; i >=0; i--) {<br />     if (myPageItems[i]  instanceof TextFrame && myPageItems[i].itemLayer.name = "listings") {<br />          myPageItems[i].applyObjectStyle(myObjectStyle);<br />     }<br />}<br /><br />myDoc.search("<g>", false, false, undefined, undefined, {appliedParagraphStyle:"OFI Body copy_GREEN BULLET"});<br />myDoc.search("<k>", false, false, undefined, undefined, {appliedParagraphStyle:"OFI Body copy_BLACK BULLET"});<br />myDoc.search("<r>", false, false, undefined, undefined, {appliedParagraphStyle:"OFI Body copy_RED BULLET"});<br />myDoc.search("< b>", false, false, undefined, undefined, {appliedParagraphStyle:"OFI Body copy_BLUE BULLET"});

  • What is the function to change paragraph styles?

    I'm trying to make a simple script that changes a raw data file that has preset Paragraph style already in the exported data from a HTML calender, and once its copied over into Indesign it changes the already existing paragraph style into a diffrent paragrph style?
    is this a simple script, I got no idea what the script function is to make the change of paragraphs.

    Would this work? or do I got the wrong function commands?
    var myInDesign = app
    var myDocument = app.activeDocument
    var myDocName = myDocument.name
    app.findParagraphStyle.caseSensitive = false;
    app.findParagraphStyle.wholeWord = false;
    app.findCharacterStyle.wholeWord = false;
    app.findCharacterStyle.caseSensitive = false;
    app.findParagraphStyle.findWhat = "SN.outabout.DAY-Gray";
    app.changeParagraphStyle.changeTo = "SN.Holiday-Day_of_the_week";
    app.documents.item(0).changeParagraphStyle();
    app.findParagraphStyle.findWhat = "SN.outabout.DATE";
    app.changeParagraphStyle.changeTo = "SN.Holiday-Month_and_Day";
    app.documents.item(0).changeParagraphStyle();
    app.findParagraphStyle.findWhat = "SN.listingsLT";
    app.changeParagraphStyle.changeTo = "SN.Holiday-Paragraph";
    app.documents.item(0).changeParagraphStyle();
    app.findCharacterStyle.findWhat = "SN.listingsBOLD";
    app.changeCharacterStyle.changeTo = "SN.Holiday-Title_Paragraph";
    app.documents.item(0).changeCharacterStyle();
    //myInCopy = CreateObject("InCopy.Application.CS3")  //Not sure if this would work, just crafting idea's.
    //var myDocument = myInCopy.ActiveDocument
    //var mySelection = myInCopy.Selection.Item(1)
    //var myStory = MySelection.ParentStory
    //var myText = myStory.Paragraphs.Item(1)
    //myStory.CheckOut
    //myText.ApplyParagraphStyle myDocument.ParagraphStyles.Item("zAPPROVED"), True
    //myStory.CheckIn
    Can I just do this with like a Nested If, then Statement?

  • Empty row using decode

    when I use the decode function I always get extra empty rows in my results. Why is this? Is it because I don't use a default value?
    I always have to use a where statement to eliminate those empty rows, like in the following statement.
    select
    decode(table.field1,'field1value','output')
    from
    table
    where
    table.field1='field1value'

    Let me try to explain using your example:
    SQL> create table mytable
      2  as
      3  select 'Weight' field1, '2' field2 from dual union all
      4  select 'Colour', 'red' from dual union all
      5  select 'Size', 'L' from dual
      6  /
    Tabel is aangemaakt.So, the table has three rows.
    SQL> select decode(Field1,'Weight',Field2)
      2    from mytable
      3  /
    DEC
    2
    3 rijen zijn geselecteerd.Since you don't have a where clause, you don't restrict the number of rows returned. The row appears empty because of the decode function, which says: "if field1 is equal to 'Weight' then display field2 else display nothing".
    SQL> select field1
      2       , field2
      3       , decode(Field1,'Weight',Field2)
      4       , decode(Field1,'Weight',Field2, field1)
      5    from mytable
      6  /
    FIELD1 FIE DEC DECODE
    Weight 2   2   2
    Colour red     Colour
    Size   L       Size
    3 rijen zijn geselecteerd.This shows that the rows are not empty, only the third column is. The fourth column is a similar decode function but with a fourth argument that additionally says "if field1 is not equal to 'Weight' then show me field1 instead of field2"
    But I guess you really want one row, the row containing 'Weight', which can be easily achieved by a where clause:
    SQL> select field2
      2    from mytable
      3   where field1 = 'Weight'
      4  /
    FIE
    2
    1 rij is geselecteerd.Hope this clarifies.
    Regards,
    Rob.

  • Is there a script to change paragraph style based on even/odd page

    Is there a script or way to have paragraph style change between 2 styles based on the text being on an even or odd page? 

    @JustMikey – as I understand your task, the problem has nothing to do with "special" paragraph styles, but (nearly) all with anchored objects (the images and parts of the gray bar) and appropriate margin settings.
    Just see the following IDML file I exported from InDesign CS5.5:
    Dropbox - ImagesAwayFromSpine-CS5.5.zip
    ImagesAwayFromSpine-CS5.5.zip
         ImagesAwayFromSpine-CS5.5.idml
         080731_Manchester-xxl_Grau.tif
    Of course you could add paragraph styles to format the data automatically or optimize in other ways.
    That's up to you. But you can see the principle:
    Inspect the Anchored Object Options for the image and the gray bar. Also the frame fitting options for the image.
    Note: See also the margin settings, that are not exactly mirrored on even and odd pages (for good reason).
    Uwe

  • Does deleting paragraph styles affect documents which used a deleted style?

    Assume you have a web page or site made with paragraph styles.
    You start a new page in that site but decide to delete a bunch of paragraph styles which you  no longer want
    The style should be in the html of the earlier documents and deleting the style should not delete the existing HTML.
    But with Muse you never can be sure.
    So is it ok to clean up the clutter and delete a bunch of old styles when creating something new or not?
    Please do not respond unless you actually know the answer. No guesses please.

    Hi Jkijki,
    If you have created a paragraph style and applied to a paragraph, when you try to delete that paragraph style you will get option to replace the paragraph styling with another style (if there exist any):
    Check this link: http://prntscr.com/3p9c5x
    Regards,
    Gaurav Aggarwal

  • [win][js][cs4]find/change paragraph styles without losing local overrides

    Hi guys i need a little help here.
    I created a javascript which will find and replace doc file paragraph styles with indesign paragraph styles. everything works fine but the problem is that when it applies the paragraph styles it loses all local overrides. i tried:
    changetext(false);
    but its not working is there some kind of conditional parameter that i can put in the changetext() function so that it wont clear local overrides?
    Thanks.
    CharlesD

    Thanks Kasyan. You're always there to save my day. Thank you very much...
    I slightly modify the script to go through all my paragraph styles that need to be replaced coz there are hundreds of them. Im not sure though if this is the best or is there any faster way to do this:
    replace("T1", "Text", "T1");
    replace("T", "Text", "T");
    replace("1", "Heads", "1");
    replace("2", "Heads", "2");
    function replace(input, folder, output) {
        var foundItem;   
        var doc = app.activeDocument;
        app.findGrepPreferences = app.changeGrepPreferences = NothingEnum.NOTHING;
        app.findGrepPreferences.findWhat = ".+";
        app.findGrepPreferences.appliedParagraphStyle = input;
        var foundItems = doc.findGrep();
        for (var i = 0; i < foundItems.length; i++) {
            foundItem = foundItems[i];
            foundItem.applyParagraphStyle(doc.paragraphStyleGroups.item(folder).paragraphStyles.item( output), false);
        app.findGrepPreferences = app.changeGrepPreferences = NothingEnum.NOTHING;

  • Changing Paragraph Style Export Tagging Options

    I'm having a heck of a time trying to get the "Split Document (EPUB only)" box checked for certain styles. I was hoping an experienced scripter may be able to help me solve what I'm sure is an easy fix.
    My code snippet is below:
    var doc = app.activeDocument;
    var par_styles = doc.paragraphStyles.everyItem().getElements();
    for (var i = 0; i < par_styles.length; i++) {
         par_styles[i].styleExportTagMap.splitDocument = true;
    In this example, I'd like to get the Split Document checkbox checked for every paragraph style in my document. However, apparently the paragraph style doesn't support the "styleExportTagMap" class, which is the only place I've found that the "splitDocument" property lives.
    I assume my ignorance arises from not knowing exactly what the styleExportTagMap(s) class does.
    Could anyone point me in the right direction?

    Seems like a hack, but it works.
    var
        doc = app.activeDocument,
        par_styles = doc.allParagraphStyles,
        i = 0;
    for ( i ; i < par_styles.length; i++ ) {
        par_styles [ i ].styleExportTagMaps.add ( "", "", "", "" ).splitDocument = true;
    Hope that helps.
    Marijan (tomaxxi)
    http://tomaxxi.com

  • XML import is changing paragraph styles?!

    After importing my translated XML-File the "copy"- Paragraph style is overwritten by my "Headline"- Paragraph style. Any Ideas why this issue is occuring? I hope the screenshot is kinda helpful in any way (simplified version of my problem) - best regards!

    On the paragraph styles panel or table styles panel, delete the style and replace with another style.

  • Changing paragraph style

    I have a requirement.Paragraph text is changing according to the customer language .
    Here when the customer is english the data is fitting properly in the layot.
    But when it comes to other language that test is coming in the next line.
    So i want to decrease the paragraph size .
    Can any one explain it in briefly.

    Hi Vinay,
           As Smartform is not client specific as SAP Scripts there is no need to worry about the text being printed. But comming to ur issue If u convert what u ave written in English, Different Languages may have different sizes and it is dynamic one cannot define it. Do please create a paragraph the max you can
    <<Text removed by moderator>>
    Thanks
    Arif Shaik
    Edited by: Matt on Nov 12, 2008 9:12 AM - Do not request or offer points

  • Changing Paragraph Style Names

    I asked this question about a month ago, but I did't really ask it right.
    I am bringing documents from InDesign to InDesign6. In the process, we are changing style names to make things future compabile by eleminating all spaces. periods, dashes, etc.
    So, for example, Heading 1 becomes Heading_1, while Page No. - Left becomes PageNo_Left, etc. Easy enough to do for one or two documents by hand, but I have literally hunders of documents that are going to need this.
    So, I'm looking to write a script to more or less automate this process. I think I need something like:
         app.documents[0].paragraphStyle.item("Heading 1").name = "Heading_1"
         app.documents[0].paragraphStyle.item(Page No. - Left).name = "PageNo_Left"
         etc.
    Am I headed in the right direction? Any advice would be greatly appreciated.

    Figured it out. Script is:
    app.activeDocument.paragraphStyles.item("Heading 1").name = "Heading_1"
    app.activeDocument.paragraphStyles.item("Page No. - Left").name = "PageNo_Left"

Maybe you are looking for