Hi TwWizards

I'm running a script via a custom ViewTemplate.
The script is removing a specified "SomeTag" from all tiddlers in the
wiki.
Same custom viewtemplate uses Eric Shulmans CheckBoxToggleTag to
toggle between "SomeTag"and "AnotherTag, therefore I use the script to
perform a "reset-function" to remove either "SomeTag" or
"AnotherTag"...
If I use solely Erics CheckBoxToggleTag transclusion the "hosttiddler"
is refreshed at once.
If I use my "reset-script" the tiddler isn't refreshed and I have to
click edit and cancel to get the result, therefore I am asking for
help in reconstructing the script to make a "refresh containing
tiddler command" when run...

The script:
<script label="Remove Sometag from all tiddlers">
var tag="SomeTag";
var tids=store.getTaggedTiddlers(tag);
store.suspendNotifications();
for (var i=0; i<tids.length; i++) { var t=tids[i];
store.setTiddlerTag(t.title,false,tag);
   store.saveTiddler
(t.title,t.title,t.text,t.modifier,t.modified,t.tags,t.fields);
}
store.resumeNotifications();
</script>

I tried to copy CheckBoxToggleTags command for refreshing the tiddler
at the end of the script:
-
var here=story.findContainingTiddler(this);
        if (here) { /* refresh current tiddler */
                var title=here.getAttribute('tiddler');
                var
template=story.chooseTemplateForTiddler(title,story.isDirty(title)?
2:1);
                story.refreshTiddler(title,template,true);
        }
        return false;

However it didn't work...- maybe because the script is removing a tag
from remote tiddlers not the hosting one....

Please excuse the complexity of my question, however the real context
is much, much more complicated - and I have struggled to make it as
simple as I possible could...

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.

Reply via email to