Hi,

In whatever macro or plugin you need to retrieve the tiddler from the 
store, change the field value and save.
Something with these lines of code in should do the trick

var tiddler = store.getTiddler('title');
tiddler.fields['fieldToChange'] = "new value"
store.saveTiddler(tiddler);
saveChanges();

Hope that helps

Colm

On Tuesday, 2 April 2013 04:27:26 UTC+1, Dave Parker wrote:
>
> Hi, I've been searching for how to set a custom field with javascript, and 
> all I can 
> find is this, which I think is a reference to the actual working source code 
> of 
> tiddlywiki (but I'm not sure).
>
>
> Story.prototype.setTiddlerField =(function (title,tag,mode,field)
> {
>       var c = this.getTiddlerField(title,field);
>       var tags = c.value.readBracketedList();
>       tags.setItem(tag,mode);
>       c.value = String.encodeTiddlyLinkList(tags);
> })
>
> ...except I'd think that you'd want to set the field by referencing 
> the "store", not the "story".
>
> I want to be able to add to or subtract from numbers stored in custom fields 
> by 
> clicking checkboxes which trigger the javascript code to set the new field 
> value.
>
> Would someone mind pasting in a snippet of code for how they do something 
> like this?
> I imagine that it should be possible to do this...
>
>
> thanks,
> Dave
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywikidev?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to