「zotero里阅读pdf时给annotation添加标签,依赖zoteroTags插件」
                
                    
                        
简介
                    
                        
                            不用tags插件可以将子程序的代码替换成:
$$ var valueInJS = "{valueFromQuicker}";
var tags=valueInJS.split(/,|,/);
//获取选中注释的HTMLDivElement对象
var div=Zotero.Reader.getByTabID(Zotero_Tabs._selectedID)._iframeWindow.document.querySelector('#annotations>div.annotation.selected');
//获取选中注释的IDvar annotationID=div.getAttribute("data-sidebar-annotation-id");
//获取pdf项目对象
let pdfitem=Zotero.Items.get(Zotero.Reader.getByTabID(Zotero_Tabs._selectedID).itemID);
//通过库和kery获取注释
let annotation=Zotero.Items.getByLibraryAndKey(pdfitem.libraryID,annotationID.replace("annotation-",));
for (var item of tags){
annotation.addTag(item);}
annotation.saveTx();
                         
                
                
                    最近更新
                    
                        
                            | 
                                修订版本
                             | 
                            
                                更新时间
                             | 
                            
                                更新说明
                             | 
                        
                            
                                | 
                                    1
                                 | 
                                
                                    
                                        2023-07-31 09:57
                                    
                                 | 
                                
                                    111
                                 | 
                            
                            
                                | 
                                    0
                                 | 
                                
                                    
                                        2023-07-30 15:40
                                    
                                 | 
                                
                                    
                                 |