Changing tags for current or selected Drafts

I’m trying to replace tags for the current draft only.

How can I alter the Script in @nahumck’s “Replace tag…” Action https://actions.getdrafts.com/a/1D7 so that is only works on the currently selected Drafts?

Is there something in this code block that can be changed?

if (con) {
var items = Draft.query("", “all”, [oldTag])
for (var item of items) {
item.removeTag(oldTag);
item.addTag(newTag);
item.update();
}
}

Thanks

Bob

it should just be this.

draft.removeTag(oldTag);
draft.addTag(newTag);
draft.update();

Any selection of Drafts you run it against should iterate through substituting in each draft as it goes to be the “current” draft.