Hi again Måns,
Turns out - since you're actually not creating any new tiddlers - you
don't need to merge config.defaultCustomFields with any existing
fields.
I have modified the script in your sandbox for the tagging rule which
you desired and tested...
<script label="Replace Text Now!">
var i,t,
tids=store.getTaggedTiddlers('UPDATE'),
tpl=prompt('Enter template name...',''),
tgs=prompt('Filter by tags...','');
tgs=tgs?tgs.readBracketedList():[];
tpl=store.getTiddlerText(tpl)||'',
i=0;
while(i<tids.length){
t=tids[i];
if(tgs.length>0&&t.tags&&!t.tags.containsAny(tgs)){
tids.splice(i,1);
}else i++;
}
if(!tids.length)alert('Nothing to replace!');
else if(!confirm("Really replace the contents of:\n"+
tids.map(function(t){return t.title;})))return;
for(i=0;i<tids.length;i++){
t=tids[i];
//skip this tiddler if tags were defined yet this one doesn't have
any of them
store.saveTiddler(
t.title,
t.title,
tpl,
config.options.txtUserName,
new Date(),
merge(t.tags,tgs),
t.fields,
t.created
);
};
store.setDirty(true);
autoSaveChanges();
</script>
YET, having added in a store.setDirty(true) did not do the trick
either. However, this works offline! So, I guess we need some
tiddlyweb/tiddlyspace magician on the boat to solve this puzzle.
Cheers, Tobias.
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/tiddlywiki?hl=en.