Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.


#4452 Macro Replay should stop on failure


If a macro is recorded and executed multiple times, the macro should stop, or at least give the OPTION to stop, upon the 1st failure.

To reproduce:
1. Create a file that has a series of lines containing "AAAA" "BBBB" "CCCC" "DDDD" ... "ZZZZ" so you end up with 26 lines.
2. Copy & Paste the entire page multiple times.
3. Navigate to the top of the page.
4. Search for "BBBB".
5. Navigate to the top of the page again.
6. Create a macro that does the following: <Find Next=""><go to="" start="" of="" line=""><Delete entire="" line=""> Then stop recording.
7. Navigate to top of page.
8. Execute macro multiple times and select "Run until end of file".

My expectation would be that the macro runs until the last line that contains "BBBB" is found and deleted then it hollers that it can't find "BBBB" and stops.

What actually happens is:
A. Holler that desired text can't be found.
B. Delete current line.
C. If not at end of file, go to "A"
D. End

There seems to be NO WAY to stop this other than killing off the process or the last line has been deleted.


  • I don't fully understand what you're trying to do (there appears to be something missing in step 6), but it seems to me like it would be very difficult for Notepad++ to automatically understand what "failure" means for a given macro step.

    Have you considered using a proper scripting language instead?

  • Don

    Yep...I understand why you don't understand. what SHOULD have been in at step 6 was:

    do a "find next"
    go to the start of the line
    delete to the end of the line

    I'd bracketed each step with angle brackets. Looks like they were stripped off, along with what was between.

    My bad! :-(