Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #8735

    user
    Participant

    hello

    I don’t know if it is easy to do what I want or there is a tool already available… well, I have a text file with a list of sentences (each sentence seperated with a newline)

    what I want is to group/organize the sentences, by cutting them and pasting them to specific text files (other that the one with the sentences list)

    so I want to automatically select a sentence, cut it, and paste it in the appropriate text file by clicking a shortcut key
    then select the next one, cut and paste it in the appropriate text file, etc

    to choose the appropriate target text file, where I want each sentence to go, I must click the relevant shorcut key

    that would be very handy for this kind of job, any suggestion??

    thanks

    #8737

    Yutaka Emura
    Keymaster

    Hi user,

    This is an example of a JavaScript macro:


    sText = document.selection.Text;
    if( sText != "" ) {
    menu = CreatePopupMenu();
    nCount = editor.Documents.Count;
    for( i = 1; i <= nCount; i++ ){
    doc = editor.Documents.Item( i );
    if( doc != document ){
    menu.Add( doc.FullName, i );
    }
    }

    result = menu.Track( 0 );
    if( result != 0 ) {
    docOrg = document;
    doc = editor.Documents.Item( result );
    doc.Activate();
    document.selection.EndOfDocument();
    document.selection.Text = sText;
    docOrg.Activate();
    document.selection.Delete();
    }
    }

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

Share with friends... Tweet about this on TwitterShare on FacebookShare on Google+Email this to someone