Templater stop working after last update

i have a template like this, that was working before update

let tfil = app.workspace.lastOpenFiles[0];
let tfile = tfil.replaceAll(“.md”, “”);
let cache = app.metadataCache.getCache(tfil);
let tag= cache.frontmatter[“tags”];
aliases: []
tags: [<% tag %>]

Creation: =this.file.cday
Last Change: = date(today).day - this.file.mtime.day + " Days"

:small_red_triangle:: [[<% tfile %>]]

1 Like

Change first line to
let tfil = app.workspace.recentFileTracker.lastOpenFiles[0];

1 Like

same problem, templater is not getting the frontmatter

i think you get this code somewhere here, i got too, i was using a similar one
and the problem is the cache= line

tfil = app.workspace.getLastOpenFiles(this);
tfile = tfil[0].replaceAll(“.md”, “”);
cache = app.metadataCache.getCache(tfil[0]);
tag_recall= cache.frontmatter.tags;

on obsidian console is working, but when templater trigger it dosnt

Someone knows how to fix this ?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.