TiddlyTouch - help with a Button

72 views
Skip to first unread message

BurningTreeC

unread,
Jan 20, 2018, 4:00:41 PM1/20/18
to tiddl...@googlegroups.com
Hello awesome TiddlyWiki community people,

I need help with a button, I just cannot get why it doesn't work. maybe you can help me

The problem is, that everything works but the second <$action-setfield> in <<theButton>> - I have no clue why
The variables there are all passed as I've checked them.. boh

this is the button:

\define columnicons()
{{$:/plugins/BTC/tiddly-touch/icons!!columns-$(tiddlerWidth)$}}
\end
\define theButton()
<$button class="tc-btn-invisible tc-toolbar-icon tc-toolbar-icon-topleft" tooltip="toggle tiddler width">
<$list filter="[[$(tiddlerWidth)$]!regexp[^0]]">
<$action-setfield $tiddler="$(storyTiddler)$" $field="muuri-tiddler-width" $value="$(nextValue)$" $timestamp="no"/>
<$action-setfield $tiddler="$(nextStoryTiddler)$" $field="muuri-tiddler-width" $value="$(nextNextValue)$" $timestamp="no"/>
</$list>
<$list filter="[[$(tiddlerWidth)$]regexp[^0]]">
<$action-setfield $tiddler="$(storyTiddler)$" $field="muuri-tiddler-width" $value="6" $timestamp="no"/>
</$list>
<<columnicons>></$button>
\end
\define toggle-tiddler-width()
<$set name="tiddlerWidth" filter="[[$(storyTiddler)$]has[muuri-tiddler-width]get[muuri-tiddler-width]regexp[^(0|1|2|3|4|5|6)$]] [[$(storyTiddler)$]has[muuri-tiddler-width]get[muuri-tiddler-width]!regexp[^(0|1|2|3|4|5|6)$]addprefix[0]] [[$(storyTiddler)$]!has[muuri-tiddler-width]addprefix[0]removesuffix[$(storyTiddler)$]]">
<$set name="nextValue" filter="[<tiddlerWidth>next[$:/plugins/BTC/tiddly-touch/Buttons/toggle-tiddler-width]]">
<$set name="nextNextValue" filter="[<nextValue>next[$:/plugins/BTC/tiddly-touch/Buttons/toggle-tiddler-width]]">
<$set name="nextStoryTiddler" filter="[[$(storyTiddler)$]next[$:/StoryList]]">
<<theButton>>
</$set></$set></$set></$set>
\end
<<toggle-tiddler-width>>


thanks for your help!

Simon


BurningTreeC

unread,
Jan 20, 2018, 4:03:05 PM1/20/18
to TiddlyWiki
edit: removed an unset variable that was just temporary (thisCurrentTiddler :D)

BurningTreeC

unread,
Jan 20, 2018, 4:36:47 PM1/20/18
to TiddlyWiki
update to this issue:

now I know why, but I don't know how to solve it:

the tiddler, the second action gets applied to, gets read from the storylist and can have [[ ]] brackets.

I need it's name without brackets. How can I get that?

BurningTreeC

unread,
Jan 20, 2018, 4:38:20 PM1/20/18
to TiddlyWiki
update ( 5 seconds later )

I've answered it to myself - this happens often lately to me - I think I'm getting old 

coda coder

unread,
Jan 20, 2018, 4:39:22 PM1/20/18
to TiddlyWiki
If the values in the variables might contain spaces, you probably want to use triple-quotes:

"""$(nextStoryTiddler)$"""

Just a guess - didn't look any deeper.

BurningTreeC

unread,
Jan 20, 2018, 4:45:58 PM1/20/18
to TiddlyWiki


Am Samstag, 20. Januar 2018 22:39:22 UTC+1 schrieb coda coder:
If the values in the variables might contain spaces, you probably want to use triple-quotes:

"""$(nextStoryTiddler)$"""

Just a guess - didn't look any deeper.

yes that'd be better, thanks! 

BurningTreeC

unread,
Jan 21, 2018, 1:10:36 AM1/21/18
to TiddlyWiki
I want to share what the problem was, because this happens to me twice a month

the set-widget filter gets the Tiddler names with brackets, the list-filter without


We should create some TiddlyWiki mantras for things like that :)
Reply all
Reply to author
Forward
0 new messages