[Share] Auto-run Better Notes template when opening an item #108
Replies: 9 comments 29 replies
-
This will create a new note on every object that doesn't have an auto-template note. If users want to change this to run only if there is no other note already attached to an item, change the code starting with // Check if any note exists for the item
const autoTemplateTag = "auto-template";
const notes = Zotero.Items.get(item.getNotes());
if (notes.length > 0) {
return "A note exists for this item";
} |
Beta Was this translation helpful? Give feedback.
-
I do not find the extensions.actionsTags.customAction.autoRunBNTemplate |
Beta Was this translation helpful? Give feedback.
-
“During the first run (opening file), you will be asked to choose a template to be executed.”为什么我打开笔记工作区,没有弹出来呢? |
Beta Was this translation helpful? Give feedback.
-
这里能不能完善一下,事件为关闭tag时,先删除已有的annotation,再自动生成一个,因为每次打开tag的目的是阅读更新,阅读完标注后期待模板能自动更新一下,就免去手动导入了 |
Beta Was this translation helpful? Give feedback.
-
根据颜色分类整理注释到笔记中的笔记模板需要每次打开时更新笔记。因此修改一下大佬的action 插件内容为 检测到存在 auto-template标签笔记则删除它,然后继续创建。 action代码如下。另附传送门windingwind/zotero-better-notes#668 (comment) 可以根据注释颜色分类整理进笔记的better note笔记模板。二者可以结合使用。
|
Beta Was this translation helpful? Give feedback.
-
如果模板数量足够多,会导致模板显示不完全,以及 SelectAll,Deselect All,OK,Cancel 等按钮不显示,请问此时应该如何修改 window.openDialog 代码? 例如 let tags = await Zotero.Tags.getAll();
let templateNames = tags.map(t =>t.tag);
function selectItems(itemList) {
var io = { dataIn: itemList, dataOut: null };
window.openDialog("chrome://zotero/content/ingester/selectitems.xhtml",
"_blank", "chrome,modal,centerscreen,resizable=yes", io);
return io.dataOut;
}
templateName = Object.values(selectItems(templateNames.slice(0,40)));
console.log(templateName); |
Beta Was this translation helpful? Give feedback.
-
window.openDialog("chrome://zotero/content/ingester/selectitems.xhtml", 修改为 // window.openDialog("chrome://zotero/content/ingester/selectitems.xhtml",
window.openDialog("chrome://scaffold/content/select.xhtml", 即可正常使用,新版本增加了滑动翻页显示,避免模板较多时显示不全。
|
Beta Was this translation helpful? Give feedback.
-
Description
Auto-run Better Notes template when opening an item
Action Script
Event: Open File
Operation: Script
Data:
Beta Was this translation helpful? Give feedback.
All reactions