On Sep 19, 6:28 pm, Zans Mihejevs <[email protected]> wrote:
> I'm trying to create a script that would automatically change a
> property of a tiddler when some event happens. For example, I would
> like to make it so that if I press a checkbox a certain Tiddler's
> "modified date" would change to today (I'm using CheckBoxPlugin).
> Would anyone have any advice?
One way you could go about it is to assign code like the following to
the action of checking the box:
var tid = store.fetchTiddler('your tiddler title');
tid.modified = new Date();
store.saveTiddler(tid.title, tid.title, tid.text, tid.creator,
tid.modified, tid.tags, tid.fields);
This fetches the tiddler object from the tiddlywiki store, changes the
modified date to the current date and time and then saves it.
That should do it. If you need anymore help let us know
Colm
--
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.