Hi Tobias
How do i make this script actually *replace* text (and *not* fields)
For now I'm using it to add text - which is fine - however I have made
a lot of entries that I would like to replace, either with a blank
textarea or with a new modified template.
I tried to remove the +txt bit after store.getTiddlerText(t.title)
+'\n' and not the rest - to keep fields etc... That didn't work...
> <script label="Replace Text Now!">
> var t,i,
> tids=store.getTaggedTiddlers('UPDATE'),
> txt=store.getTiddlerText('NEWTEXT')||'';
> 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];
> store.saveTiddler(
> t.title,
> t.title,
> store.getTiddlerText(t.title)+'\n'+txt,
> config.options.txtUserName,
> new Date(),
> t.tags,
> t.fields,
> t.created
> );};
>
> </script>
Cheers Måns Mårtensson
--
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.