Stop session if pattern exists?

Sorry, this one is probably pretty simple. How do you stop scraping if an extractor pattern is found?

More specifically, I have 5 or so scrapable files. if an extractor pattern is found in pattern 3 i want it to skip the last two scrapable files and end the session.

If the trigger is the only

If the trigger is the only thing in the extractor pattern, it's super easy. Just have a script that runs "once if pattern matches", and it just has:

session.stopScraping();