creation date: <% tp.file.creation_date() %>
modification date: <% tp.file.last_modified_date(“dddd Do MMMM YYYY HH:mm:ss”) %>
今天日期
<% tp.date.now(“YYYY-MM-DD”, 0) %>
网络请求
<% tp.web.daily_quote() %>
网络图片
<% tp.web.random_picture(“200x200”, “girl”) %>
剪贴板
<%*
let file = await app.workspace.getActiveFile();
let fileName = file.basename
navigator.clipboard.writeText(fileName)
%>
弹框
请输入关键词: <% tp.system.prompt(“这是模板普通弹框测试”) %>
Mood today: <% tp.system.suggester(“这是模板列表弹框测试, [“Happy”, “Sad”, “Confused”]) %>
Picked file: [[<% (await tp.system.suggester((item) => item.basename, app.vault.getMarkdownFiles())).basename %>]]
if语句
<% if (tp.file.title.contains(“模板”)) { %>
这是模板生成的文件 !
<% } else { %>
这不是模板生成的文件 !
<%* } %>
函数文件名
<%*
function log(msg) {
console.log(msg);
return msg;
}
%>
< %
<% log(“Title: “ + tp.file.title) %>
< %~
<%~ log(“Title: “ + tp.file.title) %>
Commands - Templater (silentvoid13.github.io)
< %*
<%* log(“Title: “ + tp.file.title) %>
Execution Commands - Templater (silentvoid13.github.io)
< %+
<%+ console.log(“Title: “ + tp.file.title) %>
<%+ tp.file.title %>
Dynamic Commands - Templater (silentvoid13.github.io)
< %-
<%+ log(“Title: “ + tp.file.title) -%>
< %_
<%+ log(“Title: “ + tp.file.title) _%>
Whitespace Control - Templater (silentvoid13.github.io)
运行脚本文件
<% tp.user.my_script(“Hello World!”) %>
名人名言
思路是最重要的, 其他的百度, bing, stackoverflow, github, 安卓文档, autojs文档, 最后才是群里问问
—- 牙叔教程
声明
部分内容来自网络
本教程仅用于学习, 禁止用于其他用途
bilibili
微信公众号 牙叔教程

QQ群
747748653

