<%* const files = tp.app.vault.getMarkdownFiles(); const today = tp.date.now(“YYYYMMDD”); let maxNumber = 0; for (const file of files) { const cache = tp.app.metadataCache.getFileCache(file); const fm = cache?.frontmatter; if (!fm) continue; const values = [ fm.postId, fm.commentKey, fm.url ]; for (const value of values) { if (value === undefined || value === null) continue; const text = String(value); const match = text.match(/lsb-(\d{8})-(\d+)/); if (!match || match[1] !== today) continue; const number = parseInt(match[2], 10); if (!isNaN(number) && number > maxNumber) { maxNumber = number; } } } ...

1 分钟 · 136 字 · LS

<%* const files = tp.app.vault.getMarkdownFiles(); const today = tp.date.now(“YYYYMMDD”); let maxNumber = 0; for (const file of files) { const cache = tp.app.metadataCache.getFileCache(file); const fm = cache?.frontmatter; if (!fm) continue; const values = [ fm.postId, fm.commentKey, fm.url ]; for (const value of values) { if (value === undefined || value === null) continue; const text = String(value); const match = text.match(/lsb-(\d{8})-(\d+)/); if (!match || match[1] !== today) continue; const number = parseInt(match[2], 10); if (!isNaN(number) && number > maxNumber) { maxNumber = number; } } } ...

1 分钟 · 136 字 · LS