Exporting multiple plaintext files from the content of one existing text file

Upload your actual macro, not screen shots -- you'll find instructions at How to Post/Upload your Macros and Scripts. Not only does that save us from having to type out wacky regexs (lots of opportunities to make a mistake!), we get to see any options you may have set in the actions.

While complicated regexs are fun, multiple simpler actions are often easier -- in this case I'd probably use a "For Each: separated by ☆☆☆" to get each chunk, then process.

All that said -- the problem here is that your "Search" action inside the "For Each" is searching the System Clipboard again and again, finding the first match. You actually want to search the loop's current item, the variable fullText.

FWIW, here's my version -- as set it'll write the files to the Desktop:

Test Script for saving text files 2.kmmacros (3.2 KB)

Image

2 Likes