Batch Replace Across Text Files with a Verified File Scope

A controlled batch replacement across selected manuscript files

A text editor batch replace across multiple files fails this chapters-only test if it changes the four matches under references. The observed baseline is narrower: hands-on verification limited the scope, reviewed the proposed changes before execution, replaced three matches in two files, and reverse-searched the old and new terms. The planned ten-chapter, twelve-match specimen extends that boundary but has not been run. Unsaved tabs and the interface path also remain unverified.

Fix the target boundary from the observed two-file result

Freeze the root folder, exact file list, count by file, and exclusions. If ten chapter files contain twelve matches while three reference files contain four more, the expected change is twelve, not sixteen.

Select chapters and explicitly exclude references, generated HTML, and backups. The exclusion list is part of the verified result.

Use the file breakdown as preview

Record two matches in chapter01, one in chapter02, and so on. Read representative context. If occurrences need semantic exceptions, leave batch replacement for the context workflow in the single-chapter exception-aware replacement workflow.

Record open unsaved tabs because their content may be included even when it is not yet represented on disk.

Verify changes and nonchanges

After replacement, search the old term in chapters and expect zero. Search the new term and expect the starting count plus twelve. Zero old terms with only eleven new terms is not a pass.

Search references and confirm that its four old forms remain. Intended changes and deliberate nonchanges prove the scope together.

Use counts to choose the return point

Sixteen changes indicate a failed exclusion. Eleven indicate a file-list or search-condition problem. Too many new forms indicate an incomplete baseline. This article uses one literal string and excludes regular-expression design, binaries, and generated output.

Keep the manuscript as authority and regenerate derivatives rather than editing generated HTML.

State the observed two-file, three-replacement scope

Current macOS Rune Studio documentation describes workspace search limited to selected files or folders and inclusion of unsaved tabs in replacement.

In a controlled four-file test, limiting the target to txt files in the manuscript folder produced three matches across two files. Replacing within that same boundary changed those three matches. Reverse searches then showed zero old forms in scope, four new forms because one already existed, and one excluded old form in the reference file; both changed files were reread.

That evidence does not cover ten files, twelve replacements, an unsaved tab, or the confirmation UI. Treat the article’s larger manifest as a reader-run audit design. Review documented scope on the Rune Studio product page. Single-file search, count-only workspace review, and semantic exception selection belong to neighboring articles.

Freeze ten targets and three exclusions separately

List chapters/01 through chapters/10 one per row and place the character sheet, timeline, and old draft under exclusions. A folder name alone is unstable because a newly added file can silently change scope. Record the old-form count by chapter as 2, 1, 0, 3, 1, 1, 0, 2, 1, and 1, totaling twelve, while the three reference files contain four excluded matches.

Do not execute merely because preview totals twelve. If chapter 3 rises from zero to one while chapter 4 falls from three to two, the total hides a changed specimen. Compare file name, starting count, and target status immediately before replacement.

Separate verified reverse search from unverified unsaved-tab handling

An unsaved chapter can make the editor result differ from files on disk. Listing each unsaved tab and choosing save or exclude is a general precondition, but the current hands-on verification run did not exercise Rune Studio’s unsaved-tab path. Keep that product result pending. Reverse search was observed on the smaller saved-file sample. In the article-specific plan, search for zero old forms and twelve new forms and confirm four excluded reference matches remain old.

Keep a readable manifest, not only a file count

Record chapter01.md through chapter10.md, not merely ten files. If a chapter is later added, a count-only record no longer identifies the original scope. Preserve the names and starting modification state so the exact set can be reconstructed.

Do not add or rename files during execution. If the set changes, close the old run and collect a new baseline. A frozen manifest makes count differences meaningful.

Keep the unsaved-tab UI case pending

If chapter05 has an unsaved sentence containing the old term, the audit card must separate thirteen active matches from twelve stored matches. Before replacement, either save and establish a new baseline or explicitly adopt thirteen as the active expectation. This is an unverified UI test condition, not an observed result from the current hands-on verification run.

Check unsaved changes before closing tabs and distinguish screen state from saved artifacts. A term that returns after restart may then be diagnosed as an unsaved-state problem rather than a missed search result.

Explain the count difference before saving

Twelve new forms do not finish the audit by themselves. Confirm zero old forms and twelve new forms in the ten targets while the four excluded reference matches remain old. If thirteen new forms appear, distinguish a pre-existing new form from a write outside scope.

When the difference cannot be explained, do not save or promote the copy. Return to the readable file manifest and the per-file diff.

Conditions for saving the twelve replacements

Leave an auditable batch-replacement record

Freeze a manifest of ten target chapters and three excluded reference files. Explain twelve target matches and four exclusions in preview, replace only a copy, then reverse-search for zero old forms, twelve new forms, and four untouched exclusions. If the difference cannot be explained, return to the manifest and diff without saving. Check documented scope on the Rune Studio product page without promoting the observed two-file, three-replacement run into a ten-file or unsaved-tab pass.