I created a similar script last year to experiment with things, but I’m also finding that it’s broken with more recent versions of TW. I haven’t got time to experiment with it now, but I’ve attached the script below in case it’s helpful,
#!/usr/bin/env node
/*
Use crude search and replace to change a TiddlyWiki file to use different vocabulary
*/
var sourceFilepath = process.argv[2],
destFilepath = process.argv[3];
if(!sourceFilepath || !destFilepath) {
console.error("Missing filepaths");
process.exit(1);
}
var SUBSTITUTIONS = [
[/TIDDLYWIKI/g,"XEMEMEX"],
[/TiddlyWiki/g,"Xememex"],
[/tiddlywiki/g,"xememex"],
[/CARD/g,"BARD"],
[/Card/g,"Bard"],
[/card/g,"bard"],
[/TIDDLER/g,"CARD"],
[/Tiddler/g,"Card"],
[/tiddler/g,"card"],
];
var fs = require("fs"),
path = require("path");
var text = fs.readFileSync(sourceFilepath,"utf8");
SUBSTITUTIONS.forEach(function(substitution) {
text = text.replace(substitution[0],substitution[1]);
});
fs.writeFileSync(destFilepath,text,"utf8");