Hi gino_m,
wow thanks!!!
Using ChatGPT, I understood that if have to use that snippet of your code:
<%*
// Check if the 'Englishtexttranslated' tag exists before adding it
setTimeout(() => {
app.fileManager.processFrontMatter(tp.config.target_file, frontmatter => {
if (!frontmatter['tags'] || !frontmatter['tags'].includes('Englishtexttranslated')) {
const tagsArray = Array.isArray(frontmatter['tags']) ? frontmatter['tags'] : [];
if (!tagsArray.includes('Englishtexttranslated')) {
tagsArray.push('Englishtexttranslated');
frontmatter['tags'] = tagsArray;
}
}
});
}, 350); // Timeout to allow preceding clipboard operations to complete
_%>
and change “tags” to any key I want and change “Englishtexttranslated” to any value I want to add.
If I want to have more properties added, I have to copy that part of the snippet:
if (!frontmatter['tags'] || !frontmatter['tags'].includes('Englishtexttranslated')) {
const tagsArray = Array.isArray(frontmatter['tags']) ? frontmatter['tags'] : [];
if (!tagsArray.includes('Englishtexttranslated')) {
tagsArray.push('Englishtexttranslated');
frontmatter['tags'] = tagsArray;
}
}
Thanks a lot gino!