module.exports = function(prop_name) { let max = -1; for (const f of app.vault.getMarkdownFiles()) { const fm = app.metadataCache.getFileCache(f)?.frontmatter; if(typeof fm?.[prop_name] === "number") { max = Math.max(max, fm[prop_name]) } } return max + 1 }