Manually Modified md files overwritten by synch

I have a script that does some modifications of old journal markdown files (standardizing some fields, etc). However, when I run it and it modifies those files, synch then immediately overwrites them back to the original condition.

I tried turning off sync, running, then turning back on sync, and got the same thing.

I tried turning off sync, running, rebuilding database, then turning back on synch, again, overwritten.

Any advice? I would think there’s got to be a lot of users that manipulate the md files directly AND use sync.