Viewing 1 post (of 1 total)
  • Author
    Posts
  • #5804

    PaperPlate
    Participant

    This macro must follow either a FindInFiles result or after using the FindALl macro (or a macro with similar outputs). You can edit the output of either of these functions and then use this macro to “dump” your edits back in. It uses the tags to link back to the original document and insert the changes to the line.

    Note: If your file is not saved prior to running the macro (or prior to running the FindInFiles or FindAll macro) you could be dumping to the wrong location. If you’re deleting a whole line from the output you still need the tag, with the blank/s to the right of it, to dump in the blank at the location.

    Save as a Javascript (.js) file:

    docSearch = editor.ActiveDocument;
    docSearch.Activate();
    docSearch.selection.StartOfDocument();

    docSearch.selection.SelectLine();
    test = docSearch.selection.Text;
    if (test.charAt(1) != “:”) {
    alert(“This macro must be run after an All; in the All tab.”);
    docSearch.selection.StartOfDocument();
    Quit();
    }

    y = 1;
    do {
    docSearch.selection.SetActivePoint( eePosLogical, 1, y );
    if( y != docSearch.selection.GetActivePointY( eePosLogical ) ) break;

    docSearch.selection.SelectLine();

    sLine = docSearch.selection.Text;
    sLineLimiter = (sLine.indexOf(“:”, 2) + 2);
    sLine = sLine.substr(sLineLimiter);

    docSearch.selection.StartOfLine();
    editor.ExecuteCommandByID(4147);

    document.selection.SelectLine();
    document.write(sLine);

    docSearch.Activate();
    y++;
    } while( true );

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.