Applying Templates to multiple Files based on Tags

What I’m trying to do

I want to update frontmatter of all notes tagged as “article” using Templater.

Things I have tried

I have learned how to update the frontmatter for all the files (Templater snippets).

And I also learned that for suggesters you can filter files based on tags (Templater snippets).

Based on these two snippets, I came up with the following snippet:

await Promise.all(
  app.vault.getMarkdownFiles().filter(f => f.file.tags.includes("article")).map(async file => {
    try {
      await app.fileManager.processFrontMatter(file, (frontmatter) => {
        frontmatter["aliases"] = tp.file.content.split(/[\[\]]+/)[1];
    } catch (err) {
      console.error(`Failed to process ${file.path}\n\n${err}`);

The problematic part being:

app.vault.getMarkdownFiles().filter(f => f.file.tags.includes("article"))

You’re not saying what’s problematic with that part, and what error messages, or what doesn’t happen like you envisioned it.

Neither do you show/indicate what you expect out of the tp.file.content split operations. Do you intend for the aliases to be based upon the current file’s content somehow?

In short, it’s hard to help when you don’t explain the full use case, and what’s currently happening.