Added to TW-Scripts.

Many Thanks Eric,
 Yep, I used the same in Tiddler Commander! 

--Mohammad

On Friday, January 10, 2020 at 5:42:55 PM UTC+3:30, Eric Shulman wrote:
>
> On Friday, January 10, 2020 at 5:41:52 AM UTC-8, Mohammad wrote:
>>
>> While Tiddlywiki does not allow to add fileds with space in name or 
>> uppercase word!
>> but it seems the through the $action-setfield it is possible.
>>
>
> This does seem like a "hole" in the core handling.  Also, when you save 
> and reload the file,
> the upper case letters are automatically re-mapped to lowercase, but the 
> spaces result
> in TWO fields (e.g., "this field" becomes two fields, "this" and "field").
>
> I ran into this problem myself while working on a project, and here's my 
> "fixup" for it:
> <$vars fieldName={{{ [<fieldName>split[ ]join[_]lowercase[]] }}}>
> What this does is replace spaces with underscore, and change all uppercase 
> to lowercase
>
> For example:
> <$edit-text tiddler="$:/temp/newfieldname">
> <$edit-text tiddler="$:/temp/newfieldvalue">
> <$button> make field
>    <$vars fieldName={{{ [{$:/temp/newfieldname}split[ ]join[_]lowercase[]] 
> }}}>
>    <$action-setfield $field=<<fieldName>> 
> $value={{$:/temp/newfieldvalue}}/>
>    </$vars>
> </$button>
>
> enjoy,
> -e
>
>
>
>
>
>
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/b9c53a8d-481a-4567-8531-06fe4d944732%40googlegroups.com.

Reply via email to