// Remember to backup your database (zotero.sqlite) file first: // https://www.zotero.org/support/zotero_data#backing_up_your_zotero_library // Scripts crudely created by Peter Lee 3/2/2015 // based on suggestions here: https://forums.zotero.org/discussion/7707/find-and-replace-on-multiple-items/ var fieldName = "publicationTitle"; var oldValue = "Appiled"; var fieldID = Zotero.ItemFields.getID(fieldName); var s = new Zotero.Search; s.addCondition(fieldName, 'contains', oldValue); var ids = s.search(); if (ids) { for each(var id in ids) { var item = Zotero.Items.get(id); var mappedFieldID = Zotero.ItemFields.getFieldIDFromTypeAndBase(item.itemTypeID, fieldName); var tempTitle = item.getField('publicationTitle'); var newValue = tempTitle.replace(/\bAppiled\b/gi, "Applied"); item.setField(mappedFieldID ? mappedFieldID : fieldID, newValue); item.save(); } alert(ids.length + " items updated"); } else { alert("No items found"); }