Split and Merge Paragraphs

When I split and merge a paragraph a line break is inserted.  Does anyone know a way around this. (Simply deleting the last character seems inelegant and, more importantly, prone to failure).  Here's the code:
var textFlow:TextFlow = TextConverter.importToFlow(
                    "Hello World",
                    TextConverter.PLAIN_TEXT_FORMAT);
textFlow.interactionManager = new EditManager();
var textFlow2:TextFlow = textFlow.splitAtPosition(5) as TextFlow;
textFlow2.interactionManager = new EditManager();
textFlow.mxmlChildren = textFlow.mxmlChildren.concat(textFlow2.mxmlChildren);
trace(textFlow.getText()); // returns "Hello\n World"
- Daniel Freiman

If you are asking how to split and merge a paragraph this works.
            var textFlow:TextFlow = TextConverter.importToFlow("Hello World",TextConverter.PLAIN_TEXT_FORMAT);
            // find the paragraph
            var para:ParagraphElement = textFlow.findLeaf(5).getParagraph();    // same as textFlow.getChildAt(0)
            // split paragraph at position five
            var newPara:ParagraphElement = para.splitAtPosition(5) as ParagraphElement;
            trace(textFlow.getText());
            // now the merge
            // remove newPara its being discarded
            newPara.parent.removeChild(newPara);
            // move the children
            while(newPara.numChildren)
                para.addChild(newPara.getChildAt(0));
            trace(textFlow.getText());
This is using pure model level calls.  In your original code you added an EditManager- it can be done that way too.  TLF is layered - the EditManager manipulates the model with model level calls.  It provides APIs connected to events that create operations do to that.
Hope that helps,
Richard

Similar Messages

  • BPM Split and Merge

    Hi...
       I want to do scenario like file split and merge using BPM.
    for that i have used,
    1.Receive
    2.Transformation(1:N)
    3.Block(ForEach)
    4.Control
    5.EndBlock
    6.Transformation(N:1)
    7.Send.
    while executing the scenario, the message is going to the queue. In that it is showing the status as "Running".
    can you please tell if i did wrong in my scenario?

    > 1.Receive
    > 2.Transformation(1:N)
    > 3.Block(ForEach)
    > 4.Control
    > 5.EndBlock
    > 6.Transformation(N:1)
    > 7.Send.
    U are using an empty infinite block and hence it is in running state always. You dont need a block at all. after 1:n transformation, use the n:1 transformation and send. I know you must be doing a sample scenario. In reality you will have a send step usually for sending to another system line by line. That when you will need a block.
    VJ

  • Split and merge frames.

    Hello everyone. Simple question.
    When i want to make rectangle path  with many rows and columns i use arrows on keyboard. (like this video  http://www.youtube.com/watch?v=5Gjhpk8Vmo0 )  But, how can i split and then merge created frame yet? Certainly i can at once to create one frame with many columns and rows, but recently i has needed create frame with 2 rows and 3 columns, and middle columns had to be connected. I didn't know  how do that!
    Thanks! )

    Once you have created a gridified frame, then using the Gap Tool, hold down Command or Ctl key while adjusting size of frame or gap individually. Make an adjustment where the two desired frames overlap, not just against each other. Then use the direct selection tool to select overlapped frames. Then use Object > Pathfinder > Add to merge two frames. This new frame will still be live within the gridified group.

  • Can iMovie split and merge audio/video?

    Hi, I'm wondering if someone could help me in my decision of video-editing software. I'm considering buying iMovie 11 but I want to know first if it does a few things.
    Does it let you split, move, merge, trim, fade, copy/paste, and edit the volume of audio (as opposed to iMovie 08's ability to only move, trim, and fade)?
    Does it let you do the same things, but with video clips?
    Also,
    Does it let you export to HD (either 720p or 1028p)?
    Do transitions cause the video to lose quality (like they do in iMovie HD)?
    Thanks! Any sort of advice on any of these things would be VERY appreciated.

    Once you have created a gridified frame, then using the Gap Tool, hold down Command or Ctl key while adjusting size of frame or gap individually. Make an adjustment where the two desired frames overlap, not just against each other. Then use the direct selection tool to select overlapped frames. Then use Object > Pathfinder > Add to merge two frames. This new frame will still be live within the gridified group.

  • Splitting and merging columns in a table?

    Hi I have asked this question before. Does any one know how to split a column into two in a table. Know this can be done in a Word Doc. I know the merge works but can't seem to find the split.

    The merge is simple if you do not think about it as in word:))
    The merge can be done using scripting: just concatenate the values of the fields into one variable, fill in the value to the first column, change its width (to the width of the previous 4 cols) and hide te remaining/ blank cols.
    Have fun, Otto

  • Split and Merge pages of a PDF in an Outlook VB Macro

    Hello,
    I was tasked with pushing PDF attachments to our image system using a VB Macro from Outlook.  Easy enough to do by itself but there is an additional requirement to direct certain pages of the attachment to one folio in the image system and other pages to a different folio.  In the event the user doesn't separate these different documents when they submit them, our home office users must select which pages go to which area.
    I have Adobe 9.0 Pro Extended installed but the users only have Reader.
    I think the best way to approach this is to have the document opened for viewing and select pages via some control (chkbox?) to save in to a separate document.  So, if pages 1, 8, 22-24 were selected, create a new pdf in the image queue with those pages only.  Maybe this isn't possible with users that only have Reader installed, in which case another method could be suggested? 
    If I can just get a general idea on how to accomplish this, what libraries to reference and a snippet or two of code, I can probably put the rest together.  Can anyone out there help me out with a direction to head?
    Thanks!

    If it is only for split&merge you can use a freeware tool from a long list which can do it, like PDFTK, .....
    HTH, Reinhard

  • In the New Photos, why can't I split and merge events?

    I performed and Update to my computer, and that has changed the entire user interface dynamic within the photos program. I want to be able to merge and split events at will like I used to, or at least have a similar process that does not require "open, copy, copy to, open again, erase" type processes. I dislike making copies when all I want to do is group photos together without having to make another folder and delete them from the previous...items get deleted with no intent on a system like this.

    Events don't exist in the application, that's why you can't. Now the primary organisational tool is the Moment, and they are inflexible. Either use Albums or, frankly, if that's a deal breaker for you, another app.
    http://www.apple.com/feedback/macosx.html is the place for feature requests and feedback

  • [PS] Multiple array´s split and merge

    Is it possible to: when you have 3 array's split the value's after the comma and then from each array merge every 1st value with 1st, 2 with 2 and so on.
    I know you can use split to split up an array, but i have no clue how to merge it like i want.
    example:
    array 1 :
    1,7,5,0,9,1
    array 2 :
    dog,cow,cat,horse,man,girl
    array 3 :
    short,big,little,huge,long,small
    output 1 :
    1 dog short
    output 2 :
    7 cow big
    output 3 :
    5 cat little
    or even better is that it gonna be variable
    $array1 :
     1,7,5,0,9,1
    $array2 :
     dog,cow,cat,horse,man,girl
    $array3 :
     short,big,little,huge,long,small
    output 1 :  $array1 $array2 $array3
    output 1 :
     1 dog short
    output 2 :  $array1 $array2 $array3
    output 2 :
     7 cow big
    output 3 :  $array1 $array2 $array3
    output 3 :
     5 cat little
    Sincerely,
    Jeroen 

    hi Jeroen,
    sure you can do that. Simply iterate over each index of the arrays:
    $int = 0
    While ($int -lt $array1.Length)
    ($array1[$int] + " " + $array2[$int] + " " + $array3[$int])
    $int++
    Cheers,
    Fred
    There's no place like 127.0.0.1

  • Splitting and Merging Clips

    Hi,
    I have some older edited video that I want to split into separate events by shooting subject. I know how to split the clips into separate events, but my problem is that imovie has imported the video into clips that combine subjects. Is there a way to split a clip within an event? Thanks!

    Bill has assumed you mean a physical splitting of the clip and if that is what you are after then he has given you the answer.
    But you might also consider virtual splitting within a project.
    In the Project Media panel you can create one or more project folders using the Folder icon:
    You can then take your 35 minute clip and create duplicates of it in your new folder(s). NB: These are not physical duplicates, only the original 35 minute clip is on your hard disk. So you don't have to worry how many duplicates you make, they do  not take up extra hard disk space.
    Having done this you can then rename the duplicates (in my example part 1, part 2, part 3). But the clever bit, that allows you to treat each of those duplicates as a separate clip, is that you can then set unique In/Out points for each duplicate. In the screen shot following you can see the In/Out point for 'part1'. In the Media panel you can see that part_1 is 13 frames long while part_2 is 1 second & 14 frames long.
    You can add these alternate versions to the timeline and apply different effects and transitions to each part.
    Cheers,
    Neale
    Insanity is hereditary, you get it from your children

  • I have just installed iTunes on my laptop and merged tracks under various artists to form one album but when I sync iTunes to my new ipod the tracks on some of the albums are appearing as single artists..... WHY????  I

    I Have just spent the best part of a week installing iTunes on my laptop, transferring over all my music and merging tracks by different artists on one album so that they all show as one album.   I have just plugged in my new ipod classic to sync all my music but the music has gone across in random tracks and split albums.... I really am losing the will to live and am about to throw both iPod and laptop out the window.... So SOMEBODY.... Please HELP.

    'The installer has insufficient privileges to modify this file C:\Program Files (x86)\Common Files\Apple\Apple Application Support\Web kit.resources\inspector\Images\Spinner Inactive Selected.gif.'
    That one's consistent with disk/file damage. The first thing I'd try with that is running a disk check (chkdsk) over your C drive.
    XP instructions in the following document: How to perform disk error checking in Windows XP
    Vista instructions in the following document: Check your hard disk for errors
    Windows 7 instructions in the following document: How to use CHKDSK (Check Disk)
    Select both Automatically fix file system errors and Scan for and attempt recovery of bad sectors, or use chkdsk /r (depending on which way you decide to go about doing this). You'll almost certainly have to schedule the chkdsk to run on startup. The scan should take quite a while ... if it quits after a few minutes or seconds, something's interfering with the scan.
    Does the chkdsk find/repair any damage? If so, can you get an install to go through properly afterwards?

  • 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

  • Describe delivery split and shipment split

    i have a sales order, with multiple line items
    i want to create multiple deliveries form that sales order(is this process called delivery split? )
    can u tell me the process
    now can these individual deliveries split or merged to create shipment,
    whats the process?

    Hi Sudheep,
    Shipment document
    The shipping document is the central element of transportation planning and shipment completion. It contains all the
    information necessary for carrying out transportation.
    You create shipment documents using a worklist. Different types of shipment documents have been defined to enable you to reflect in the system the various forms of transportation used in your organization.
    For example, you use the individual shipment document to plan and process the transportation of goods from one location to another. You use the collective shipment to move goods from one or more points of departure to one or more destinations. Separate document types deal with inbound and outbound shipments.
    You can use shipment documents to:
    Combine deliveries into one inbound or outbound shipment
    Specify shipment stages
    o Legs
    o border crossing points
    o load transfer points
    Assign goods to handling units
    Assign service agents
    Specify planned transportation deadlines
    Record actual transportation deadlines
    Specify output required for transportation (such as shipping papers or EDI messages)
    Define transport-relevant texts
    Create Shipment Document
    Use
    After the status of the delivery is open for transportation planning, it is possible to create a shipment document to schedule the transportation.
    Logistics  Logistic Execution  Transportation Transportation Planning  Create  Single document
    T.code: VT01n
    Enter your transportation planning point and shipment type. Press enter.
    Creating the shipment cost document
    Use
    After the deliveries are scheduled by shipment and the shipment is executed, now it is time to maintain and close the shipment document in order to record all relative information and ready for the shipment cost settlement.
    Logistics  Logistic Execution  Transportation Shipment cost  Create  Single document
    T.code: VI01.
    After creation of shipment cost doc. You settle the Shipment cost.
    Go to VI02, enter shipment cost no.and press enter.
    Then go to Overview -- Fright cost items, Select hte line item and double click it.
    Go as main menu: Itme --> Acc. assignment, You enter G/L acc. and cost center to which the transportation cost will be posted.
    On the Standard change, details – Freight cost items screen, then check the check box “Transfer”, which means you will transfer the relative transportation cost to FI/CO, in this case, the system should determined which Purchase Order will used to settle the cost, so after you check the “Transfer” check box.
    Press save button on the current screen.
    Shipment cost settlement and documents:
    Use
    After the shipment cost settled in shipment cost document, it has the following affects:
    It creates a service entry sheet that refers to the purchase order determined.
    It posts acceptance of services performed.
    It creates an accounting document for the accruals.
    Further subsequent documents are created in FI.
    Reward points pls.
    Reards,
    Govind.

  • I need my keyboard to be split and at the bottom

    my keyboard was split and at the bottom of my screen and all of the sudden quit and is back in the middle, how do i get it back?

    When you have the keyboard in the 'split' option, via the Keyboard, holding down the Botton and selecting 'split', when you go to marge it back, it gives the command of "Merge and Dock". This says to me, that when you choose 'split' that it will split and go centre screen. If it was to stay at the bottom, it would just say "Merge" with the Dock, so im thinking its not a Bug, its intended, and Apple wrote the Manual wrong.
    Its easier to write words in a Manual, than it is to write code to have it 'split' and 'docked'. So it seems a intentional thing to have in mid screen IMHO anyways.

  • Splitting Data Merged File

    Hi all,
    Is there an easy way to split Data Merged file (multiple pages) into separate ID files. I know I can export them as eps but I need them to be editable in ID still.
    Many thanks.
    J

    Jensen:
    Why don't you make a master ID file for each center with appropriate data? You're defeating the purpose of data merge if you're editing pages and pages of merged files. The whole point of VDP is to create different docs based on certain pre-determined criteria. I don't know your specific workflow but if you're breaking apart and editing merged files on an ongoing basis you may want to rethink how you're creating your files and positioning your data.

  • Message splliting and Merging

    hi
    can i have any sample scenarios based on Message
    spliting and merging in bpm.
    regards
    Ramakrishna

    Hi,
               the following blogs help to learn N:1 and 1:n mapping. and also you can find the BPM pattern scenarios from Integration Repository
    /people/narendra.jain/blog/2005/12/30/various-multi-mappings-and-optimizing-their-implementation-in-integration-processes-bpm-in-xi
    /people/claus.wallacher/blog/2006/06/29/message-splitting-using-the-graphical-mapping-tool
    Just login into integration rrepository --> SAPBASIS(Component) --> http://sap.com/xi/XI/System/Patterns(Namespace).
    Here u get all BPM pattern scenario
    Thanks,
    Satish.

Maybe you are looking for