Delete specified line and next paragraph applied specified paragraph style

Hi,
How to find one of the specified line, then delete (e.g. <chapter>) and the next paragraph applied one of the paragraph style in the indesign javascript. Please explain

Hi,
Why do you want to use a [JS]? A simple grep search can do it:
If you have to do it on other "<………>", do similar regex and use Multi-Find/Change! 
Done with some work minutes!

Similar Messages

  • Open email, search for text, delete X number of lines and/or paragraphs?

    How would one go about this?
    I have existing code that uses the objActionsMenu.Execute to "resend" the message, essentially creating a new email that I can edit.
    I would like to be able to:
    1) Search for a keyword
    2) Move to the end of the line and/or paragraph
    3) Delete the contents
    The reason is that I often receive important emails with 50+ lines of names and email addresses on the "To:" or "CC:" lines. I want to quickly and easily remove these so I can get to the important part of the email.
    Am I going about it the right way? If so, how would I accomplish this? Thanks.
        

    How would one go about this?
    I have existing code that uses the objActionsMenu.Execute to "resend" the message, essentially creating a new email that I can edit.
    I would like to be able to:
    1) Search for a keyword
    2) Move to the end of the line and/or paragraph
    3) Delete the contents
    The reason is that I often receive important emails with 50+ lines of names and email addresses on the "To:" or "CC:" lines. I want to quickly and easily remove these so I can get to the important part of the email.
    Am I going about it the right way? If so, how would I accomplish this? Thanks.
    I think you maybe in the wrong forums :). This is for Excel and not Outlook. This is a general VBA question though. The easiest way to do this is the following:
    -Assign the content of the email body to a string variable.
    -Use the split function to split at the keyword, and keep the string portion BEFORE the keyword.
    -Assign the split string back to the email body so something like this:
    Public Sub ReplyWithAttachments() ' Ensure reference to Word Object model is set
    Dim rpl As Outlook.MailItem
    Dim itm As Object
    Set itm = GetCurrentItem()
    If Not itm Is Nothing Then
    Set rpl = itm.Reply
    rpl.BodyFormat = olFormatHTML
    rpl.display
    End If
    Dim objDoc As Word.Document
    Set objDoc = rpl.GetInspector.WordEditor
    Dim txt As String
    txt = objDoc.Windows(1).Document.Range.text
    txt = Split(txt, "To")(0) '
    objDoc.Windows(1).Document.Range.text = txt
    End Sub
    Function GetCurrentItem() As Object
    Dim objApp As Outlook.Application
    Set objApp = Application
    On Error Resume Next
    Select Case TypeName(objApp.ActiveWindow)
    Case "Explorer"
    Set GetCurrentItem = objApp.ActiveExplorer.Selection.Item(1)
    Case "Inspector"
    Set GetCurrentItem = objApp.ActiveInspector.CurrentItem
    End Select
    GetCurrentItem.UnRead = False
    Set objApp = Nothing
    End Function

  • Problem changing and creating paragraph styles in Pages

    When using paragraph styles I come up against several problems that I haven't been able to figure out with the help menu:
    1. When I change a para with the style list it doesn't change the para to the chosen parameters. It changes for instance the font but not the size. How do I make sure that the chosen text gets changed completely?
    2. When I want to create a new style from selection it does not create a style that turns up in future lists. I only get to choose what is already somewhere in the text I am writing and what seems to be a default list that shows up with every new document. To change to something else I have to find a text that has the format I want, copy a piece of it, put it into the text I am working on and then try and change the paragraph style. How can I make sure that I have the styles I want at my disposal whatever I am working on? Can I somehow edit the choices in the style drawer?
    3. When looking at the help menu, this is the beginning of an instruction:
    +To apply a style to one or more paragraphs, select the paragraphs you want to change, or select an entire text box, table, table cell, or shape that contains text. Click the Paragraph Styles button in the format bar, and then choose the style you want to apply+
    Now, where do I find the paragraph styles button and where is the format bar? I clicked my way through numerous drop down menus but haven't found what this is referring to.
    Would be grateful for any hints, and please keep your explanations simple enough. I need instructions for dummies Thanks in advance!

    ravenowl wrote:
    When using paragraph styles I come up against several problems that I haven't been able to figure out with the help menu:
    1. When I change a para with the style list it doesn't change the para to the chosen parameters. It changes for instance the font but not the size. How do I make sure that the chosen text gets changed completely?
    Double click on the style name in the styles drawer to completely force the style onto the selected text. This will however eliminate any bolding, italics, underlining etc.
    2. When I want to create a new style from selection it does not create a style that turns up in future lists. I only get to choose what is already somewhere in the text I am writing and what seems to be a default list that shows up with every new document. To change to something else I have to find a text that has the format I want, copy a piece of it, put it into the text I am working on and then try and change the paragraph style. How can I make sure that I have the styles I want at my disposal whatever I am working on? Can I somehow edit the choices in the style drawer?
    To add a style to the Styles Drawer, format your text, then click on the little red triangle next to the style in the drawer and choose New from selection giving it a name.
    You can also change the name of the style by right clicking on the name and selecting Rename. This is not always available as some names are reserved.
    Each document has its own definitions of the styles. You can import Styles from other documents:
    +Menu > Format > Import Styles… > Browse to a document with the styles and select those you want to copy over+
    3. When looking at the help menu, this is the beginning of an instruction:
    +To apply a style to one or more paragraphs, select the paragraphs you want to change, or select an entire text box, table, table cell, or shape that contains text. Click the Paragraph Styles button in the format bar, and then choose the style you want to apply+
    Now, where do I find the paragraph styles button
    It is the reversed blue P on the Toolbar, also +Menu > View > Show Styles Drawer+
    and where is the format bar?
    I assume you are referring to the toolbar at the top of the window.
    I clicked my way through numerous drop down menus but haven't found what this is referring to.
    Would be grateful for any hints, and please keep your explanations simple enough. I need instructions for dummies Thanks in advance!
    I suggest you download and read the Pages09_UserGuide.pdf under the Help menu.
    Peter

  • IDCS3 Getting the "next paragraph style" to work

    Hi there Adobe Forum.
    If you make a paragraph style there is an option that allows you to choose which paragraph style will follow the current one. But I can't seem to get it to work. If I just select one paragraph in my document and make it have a paragraph style that has got a "next style" option in it, the next paragraph does not change.
    I tried to select all the paragraph and do the same thing, but then they all just got that paragraph style, no next.
    How do you do to make this work? It would be really smart to just select the first paragraph of a text and then choose "ingress paragraph style", which is followed by "first paragraph", which is followed by "normal text". And then be done with it.
    Any clues?

    Select them all then in right click the first paragraph style in the
    paragraph styles panel. Select apply style and next style.
    Bob

  • Find and replace paragraph style

    I am creating a javascript for InDesign in order to search and replace some text. The text I am looking for has to be in a certain Paragraph style.
    This is what I have so far:
    app.findTextPreferences = app.changeTextPreferences = null;
    app.findTextPreferences.findWhat = '^p'
    app.changeTextPreferences.changeTo = ';'
    app.activeDocument.changeText();
    I need to find/change a return of a certain paragraph style to a semi colon. What is the script that I would use to search for paragraph style?

    try:
    app.findTextPreferences.appliedParagraphStyle = 'para style';
    If you want to replace the para style, use:
    app.changeTextPreferences.appliedParagraphStyle = 'new para style'

  • Is it a way cut and paste text and have paragraph style it

    Can I cut and paste from a word document in have indesign style it like below. Or do I have to one by one style it like below.
    Laura Benner
    Director of Human Resources
    Tiffany & Co.
    600 Madison Avenue
    New York, NY 10022
    (212) 755-8000

    You can use Apply Style, then next style to format each contact all at once. If all of the address info is exactly 4 lines long, you could have the phone number in a separate style, with Name as its next style. You could then style the whole list in one motion.

  • Script to delete the line which is small in length and line on one another

    I have lot of small unwanted lines which to be deleted manually any script which can help to deleted small line and If I delete one line i can see below it one or two line on the same line any script which can delete it.
    Please help me, just by cleaning the drawing views my eyes and hands are paining
    thanks in advance...
    regards
    Laks

    this will take care of getting rid off the small paths
    #target illustrator
    // deletes pathItems smaller than the supplied length
    var idoc = app.activeDocument;
    var howLong = prompt ("Enter the length in points of small paths to be deleted", 10, "Delete Small Paths");
    for (i=0 ; i< idoc.pathItems.length; i++)
              var ipath = idoc.pathItems[i]
                   if ( ipath.length < howLong)
                             ipath.selected = true;
    app.redraw();
    if(confirm ("Proceed to delete selected items?", "yes", "Confirm Delete"))
              app.cut();

  • [CS3 AS] set paragraph style, go to next paragraph, set paragraph style, etc.

    hello,
    i'm pretty much a noob at scripting. i'd like to automate applying paragraph styles to a document with reviews.
    basically, i want to place the cursor in a paragraph (manually), and have a script do the following: set paragraph style 5, go to the next paragraph, set paragraph style 1, go to the next paragraph, set paragraph style 2, go to the next paragraph, set paragraph style 3.
    help?
    (i specified AS as i think i might understand it, but JS probably works as well)

    Assuming you set the relationship of one style to the next using the 'Next Style' definition in the paragraph styles, then the following should do the trick (assuming you have your cursor in the first paragraph).
    > // Follows next paragraph style setting until Same Style or No Paragraph Style
    >// Get the current pagaraph based on user cursor location
    var myCurrentParagraph = app.documents[0].selection[0].paragraphs[0];
    do
    ] // Currently applied paragraph style
    var myCurrentParagraphStyle = myCurrentParagraph.appliedParagraphStyle;
    ] // Next Style for current paragraph style
    var myNextParagraphStyle = myCurrentParagraph.appliedParagraphStyle.nextStyle;
    ] // Check current style and next style are not the same or No Paragraph Style
    if (myCurrentParagraphStyle == myNextParagraphStyle
    || myNextParagraphStyle == app.documents[0].paragraphStyles.item("[No Paragraph Style]") ) {
    ]] exit(); }
    ] // Get next paragraph in chain
    var myNextParagraph = myCurrentParagraph.insertionPoints[-1].paragraphs[0];
    ] // If we are end of story then stop
    if (myNextParagraph == myCurrentParagraph) { exit(); }
    ] // Apply next style to next paragraph
    myNextParagraph.appliedParagraphStyle = myNextParagraphStyle;
    ] // Restart the process
    myCurrentParagraph = myNextParagraph;
    >while (true)
    Note that the process will end when the Next Style setting of one paragraphs is Same Style or when the Next Style is No Paragraph Style. There would be other ways to end the process, such as limiting it to a certain number of steps if the number of steps was always the same. Let me know.

  • Paragraph style - next style

    Hi!
    I have a question about paragraph-styles.
    For designing a book I receive a lot of unformatted text from different people. Now, of cause I need styles for different cases. One of those is a question-answer-style (interview -> see image below). You normaly can create a paragraph-style with the option to have, after pushing RETURN, another style (I think in english it has to be „use next style“). Okay, my problem is it works ONLY when I start typing the text word by word in Indesign an push RETURN and going on typing... That´s not what I want. My idea was, to copy an paste the whole text from Word (or from wherever) to Indesign and give´em the style it needs.
    Doesn´t it work somehow? With „nested styles“ it works neither. You can only make a „soft break“ to use next style. So I must insert it one by one after each paragraph. Not so ...
    Nochmal auf Deutsch, falls es missverständlich war:
    Also, ich möchte ein Absatzformat erstellen für ein Interview. Da ich die Texte alle nicht selber schreibe ,sondern lediglich fertig geschrieben erhalte und dann am Stück einfüge, würde es Sinn machen, eine Formatvorlage zu erstellen, welche mir bestimmte Schritte automatisch abnimmt. Es gibt diese praktische Einstellung unter "Absatzformatoptionen" -> "Formatvorlagen" -> "Nächstes Format". Das scheint aber nur zu funktionieren, wenn man den Text buchstabenweise in das vorformatierte Feld eintippt. Dann erst bekommt der Absatz nach jedem Umbruch das ausgewählte Format. Wenn ich das aber bei einem komplett eingefügten Text probiere (nach der Frage "Eingabe" drücken), pasiert nichts. Wieso? Wie kann man das hinbekommen, evtl. alternativ?

    Ok, I understand both, German and English.
    Ok, ich versteh’ beides, deutsch und englisch.
    When you select several paragraphs you can go to first paraagraph style in the pargraph style panel and choose with the right mouse click in the context menu:
    You can apply:
    This selected style
    This selected style and delete Overrides and/or Character Styles
    This style then next style
    This style then next style and delete Overrides and/or Character Styles
    Wenn Du mehrere Absätze ausgewählt hast, kannst Du im Absatzformatbedienfeld mit der rechten Maustaste das Absatzformat für den ersten Absatz auswählen und mit der rechten Maustauste aus dem Kontextmenü aus den verschiedenen Varianten wählen. Siehe oben in der Abbildung.
    Die Menüvarianten mit nächsten Absatz und Zeichenformate und Überschreibungen (nicht in der Abbildung) sind nur dann im Menü vefügbar, wenn das Absatzformat erstens einen entsprechenden Nächsten Absatz definiert hat bzw. Vorkommnisse von Zeichenformaten und/oder Überschreibungen vorkommen.
    PS. Es existiert auch ein deutsches Adobe U2U-Forum.
    Addition / Ergänzung:
    If the text is in only one frame or in only one cell of a table there exists as well the function next paragraph style. When you apply such an objects style to a text frame or to a cell of a table all text is formated according the first paragraph style choosen in the object style or cell style and the following paragraphs are styled as defined in next paragraph,
    Wenn der Text nur in einem Textrahmen oder innerhalb einer Zelle einer Tabelle ist, dann besteht die Möglichkeit, dass im Objekt- bzw. Zellenformat unter Absatzformat erstens dieses aktiviert wird und zweitens, das nächste Absatzformat aktiviert wird. Dadurch werden bei Anwendung des Objekt- bzw. Zellformats der erste Absatz und die darauffolgenden entsprechen mit den definierten Absatzformaten und nächsten Absatzformaten formatiert.
    Message was edited by: Willi Adelberger

  • Prvent from the user  deleting specific line in view table

    HI,
    In our Project we have a View Table which user can maintain ,
    the user can change or delete the line (and fields)  in this table.
    what i want is for one line for specific combination in the table to prevent from the user to delete this line ,
    so when he push on change mode and mark the line and push on delete i want to give him a error message that he can't delete this line (because the specific combination ).
    i new for the concept of the PBO PAI....
    so i appreciate any help or suggestions.
    Best regards
    Micheal A

    [Table maintenance Events|http://www.google.com/url?sa=t&source=web&ct=res&cd=4&url=https%3A%2F%2Fwww.sdn.sap.com%2Firj%2Fservlet%2Fprt%2Fportal%2Fprtroot%2Fcom.sap.km.cm.docs%2Flibrary%2Fabap%2FHow%2520to%2520implement%2520Events%2520in%2520Table%2520Maintenance.doc&ei=txFUSdKHKISeNbG1_dQP&usg=AFQjCNF3AI-77PC-MS20vx-ARd4a6zxUfg&sig2=Y_IWbHOsETvyoIrFzPxpCg]
    [SAP help|http://help.sap.com/saphelp_erp2005vp/helpdata/en/91/ca9f0ea9d111d1a5690000e82deaaa/content.htm]

  • Deleting PO line having subsequent MIRO

    Hi all,
    In our system we can delete PO line item eventhough it has subsequent MIRO. <b>We want to restrict this</b>. I could not find out any configuration for this. On SD side if we have subsequent doc, we can not delete the line item. Do we have something similar on MM side.
    I do not want to go for user-exit as i am thinking that there must be something in SAP to prevent this.
    I am working on 4.6C. Can anybody please let me know what are the different solutions available to make this happen.
    Thanks,

    HI,
    I think deleting a PO line item is not correct if further cycle is done.
    I want to know why there is a need to delete PO line item after the further procedure is done.
    To delete the line item kindly set the message as warning or as info message:
    To set it as warning follow below procedure:
    Goto SPRO - >> Public Sector Management ->> Funds Management Government ->>
    Basic Settings ->> Change Message Control ->> New netries - >> Put the message no. ->> Maintain "W" under ONLINE as well as in BATCHl column and press enter and Save data.
    Now try deleting the line and save data - system will prompt a message saying - { Exceptions have occurred (see environment -> exception messages) } then select tab Environment ->> Exception messages. There you will see the exception i.e. your message. Now save the data, system will not stop you from saving the data.
    Hpe it will solve your problem.
    Njoy lyf..
    njoy SAP...
    Regards,
    Amit P hiran

  • ID CS2 and numbering paragraph

    I try to build a paragraph style using European Pi (the Type 1 version) as the numbered character to get reversed type in a black filled circle. The rest of the paragraph is formatted with Myriad Pro. It seems to be impossible: the numbered character does not appear, whatever color is used.
    Any idea and help appreciated, thanks.

    Hi Jean-Marc,
    I suppose this is a bit late, and you've probably already solved this, but create a character style for the numbered character, and be sure to choose it in the Bullets and Numbering paragraph style options.
    This should take care of the situation.

  • How to handle paragraph styles in imported text with no tagged paragraph styles

    Hi
    Im currently trying to import a file (word file / excel I have both formats) into an indesign book and formatting the text automatically!
    My question is: How is it possible to reflow text into frames and when changing frame it changes paragraph?
    Or how is it possible to change paragraph style when forcing a line break when using text reflow?
    I have already figured out how to reflow the text, and actually also managed to relow text into the frames and change paragraph style. I know how to use the keep option, and by this change the paragraph style when e.g. changing frame break/page break etc.  (but if the content being flowed-in is not tagged with style names then I cannot figure out how to do it) The document and its content I whish to import do not have any tagged paragraphs!
    Then I tried to look into "object styles" and format a text frame on a master page with an object style, and by using a "dilimiter character" forcing the text to start in a new frame when bringing the frame into live on a page. But here I cannot make the "text frame/object style" to apply or to work.
    If any of you have a hint, I would be more than happy to hear from you
    This picture are illustrating the outcome I would to get to....

    If the incoming text does not have styles, or has only one style, there is really not much you can do other than assign styles after the import. If there are recognizable patterns in the formatting, a lot of that can be done with Find/Change, and there are a few scripts floating around that can help automate some of that.
    Also, if your styles have a a good "next style" heirarchy built in, you can select large blocks of text (up to the point where applying next style would be incorrect), then right click the style name in the paragraph styles panel and choose apply style and next style (remove overrides). Warning. Removing overrides will remove any locally applied formatting like bold or italics, so local formatting should be converted to character styles first. Applied character styles are not overrides and will be preserved.

  • Replace paragraph style [JS]

    Hi All,
    (1)
    I have a JS code for replace paragraph style (come word file (floppy style)) its working good. But my problem is that when run this code if find paragraph style not define (word file (floppy style)) in flow indesign file then error. Is that possible if paragraph style not find then ignore then run next step. Please see code below
    var myDocument = app.activeDocument;
    var myParagraphStyleA = myDocument.paragraphStyles.item("h1");
    myParagraphStyleA.remove(myDocument.paragraphStyles.item("1H: One Head"));
    (2)
    You have any script for delete only unused  (para/char (Floppy style)) only.
    Thank you so much adv.
    regard
    snegig

    Hello Sir (Harbs, Jongware and other),
    I am really sorry for late answering. I am junior so heavy workload.
    This line code "h1" paragraph style actually comes ms-word file (floppy style).
    var myParagraphStyleA = myDocument.paragraphStyles.item("h1");
    Second line code "1H: One Head" is InDesign CS4 paragraph style.
    var myParagraphStyleA = myDocument.paragraphStyles.item("h1");
    If "h1" PS comes (ms-word) in InDesign then code run good. In case if "h1" PS not comes in InDesign file then script error.
    I have just mapping both Paragraph Style (PS) (ms-word, InDesign) if both styles mapping then script run. When run same script other chapters if any tag not come form (ms-word) but whose PS define in script then script error.
    My question is that if any PS comes from (ms-word) if this style not define in script, script run properly otherwise script display massage these PS (ms-word(floppy)) not define in your script code.
    (2) My second query
    If all PS mapping by script but ms-word style (floppy) appear in my indesign file. Is that possible these PS replace (mapping) ms-word style (floppy) automatically remove.
    Thank you so much
    Regard
    snegig

  • Vertical rules in paragraph style?

    Hi,
    I'm about to design a book with a lot of interviews. To make it a bit easier for the reader to follow I've designed a thin colored line to the left of the paragraph indicating who's saying what (see pic). The problem is that I can't seem to make these lines with the paragraph style which will be a problem further down the line if I do it manual with the line-tool. So my question is; Dose anyone have a solution that will make the lines flow dynamically together with the text?

    Make a Paragraph Rule Above
    Basically - on the paragraph go to Paragraph Rules in the Paragraph Style
    Then Apply a negative right or left indent and set the point size to equal the leading of the paragraph, so if you have 5 lines and the leading is 14pt, then the pt size for the thickness of the rule should be 70
    For 8/14pt with 8 lines of text
    So Rule Below (tick box)
    Color: (pick a color)
    Weight 113pt (14 x 8 = 113)
    Width = Column
    Offset = 108 pts
    Left indent = -8.5 pts
    Right indent = 173pts
    (adjust left and right indents to vary thickness)
    It's not perfect as if the text increases or decreases you have to adjust the size of the line.
    You could always anchor an object to the text, and offset (http://help.adobe.com/en_US/InDesign/6.0/WSa285fff53dea4f8617383751001ea8cb3f-6c43a.html )

Maybe you are looking for

  • Voice mail always engaged

    Hi All,      We have a UC520 and the system is giving us an engaged tone when ever we dial voice mail from both our external and internal numbers. I have been going over and over the config and can not understand why we are getting an engaged signal

  • How do I create a new paragraph Style in Pages for iPad?

    I opened an RTF document in iOS 6 Pages for iPad. How do I create new paragraph Syles?

  • Volatile in java

    Hi, I am trying to run the following program to see how volatile variable is shared by 2 threads! The result of the program does not satisfy the definition of volatile. Please help me in checking if it is the right way ... or the codes needs any chan

  • Duplicate and remove MC's

    I have created a flash movie using actionscript 2.0 when the movie loads, stars burst out from another movie clip in all directions and then the alpha value is pulled down until they are transparent and at that point they are removed, however i need

  • Goals for 1.0?

    Is better bootup process one of the goals for 1.0? I feel that the bootup process isnt so bullet proof as other distros...