Replace Text Across Multiple Mac Manuscript Files with a Dry Run

An abstract editorial 3D still life illustrating Replace Text Across Multiple Mac Manuscript Files with a Dry Run

A Mac text editor “replace across files” workflow should not change every search match. Preview the full set, approve only contextually valid matches, apply that subset, then verify approved old text and intentional exceptions separately.

The actual sample contained eight saved chapters and two saved stand-ins, notes/unsaved-standin-1.md and notes/unsaved-standin-2.md. Every measured search and replacement command was scoped to the saved chapters directory. Those eight chapters contained 17 old-form matches: 14 approved changes and three quoted exceptions. Preview reported 14, application reported 14, approved old-form matches fell to zero, and all three exceptions remained. No real unsaved tab existed in the run, so status is partial. The untouched pre-replacement copy is the return point.

Divide 17 into 14 and 3 before editing

Freeze the eight-chapter scope and record old form, new form, and exception reason. Read all 17 contexts and classify each as approved or intentional. Do not start unless the ledger totals 14 plus three.

The three quotations deliberately retain the old form. Therefore “zero old text everywhere” is not the acceptance rule. The correct rule is zero among approved locations and three preserved exceptions.

Move from dry run to reverse search

Preview the 17 matches on a copy. Confirm that exactly 14 appear in the replacement plan and retain a chapter-by-chapter record of three exceptions. Apply only those 14 and inspect the diff.

Reverse-search the approved scope for zero old-form matches, reconcile the new form, and confirm that the three quoted cases remain. If any count differs, do not promote the output; return to the pre-replacement copy.

What Stage 4 changed

The seven operations returned all_old_matches_before=17, preview_replacements=14, applied_replacements=14, approved_old_matches_after=0, quoted_exceptions_preserved=3, and saved_chapters=8.

unsaved_tabs_included=false. The two recorded note files were saved stand-ins, not real unsaved tabs, and they were outside the measured chapter scope. The result therefore says nothing about replacement behavior or old text in actual unsaved tabs. Semantic approval and UI highlighting were also not verified by the CLI.

Keep this operation distinct from search

Rune Studio’s public documentation includes workspace search and replacement. That Stage 3 feature is separate from the observed Stage 4 subset.

STUDIO-567 counts 18 matches in 12 chapter files and four excluded refs without changing files. This article applies 14 pre-approved changes and preserves three exceptions. Regex transformations and direct edits to generated files remain outside scope.

Stop lines before production

Promote the copy only when eight saved chapters, 17 starting matches, 14 approvals, three exceptions, 14 applications, and zero approved old forms form one traceable record. The two saved stand-ins do not substitute for an unsaved-tab test. To cover actual unsaved tabs, run a separate verification that includes the save-confirmation behavior, redefine scope, and restart from the baseline count.

Any mismatch returns to the untouched copy and approval ledger. Removing the three exceptions just to reach zero is a failure. This run supports the saved eight-chapter replacement only; actual unsaved-tab behavior remains unverified. The current search-and-replace scope is available on the Rune Studio product page.