This should help to do just the active one.
var SEARCH_TEXT = "2021";
var REPLACE_TEXT = "2022";
var SEARCH_RX = new RegExp(SEARCH_TEXT, "g");
var thisDoc = app.activeDocument, thisText;
var currentFileWasReplaced = false;
for (var j = 0; j < thisDoc.textFrames.length; j++) {
thisText = thisDoc.textFrames[j];
if (SEARCH_RX.test(thisText.contents)) {
thisText.contents = thisText.contents.replace(SEARCH_RX, REPLACE_TEXT);
currentFileWasReplaced = true;
}
}
if (currentFileWasReplaced) {
thisDoc.save(); // If this doesn't work to save, do a saveAs to a specified location.
thisDoc.close(); // Should be already saved, but if not, use SaveOptions.SAVECHANGES
} else {
alert("No replacement made.");
}