Great solution Thomas. There is small typo I corrected below
\define BtnTagListops(btntext,add-
remove,tooltip)
<$button tooltip="""$tooltip$""">
<$wikify name="timestampState" text="{{$:/config/TimestampDisable}}">
<$action-setfield $tiddler="$:/config/TimestampDisable" $value="yes"/>
<$action-listops $tags="$add-remove$" />
$btntext$
<$action-setfield $tiddler="$:/config/TimestampDisable" $value=<<
timestampState>>/>
</$wikify>
</$button>
\end
Calling macro
\define todoBtnDoNow()
<$wikify name="tt" text="switch tags">
<$macrocall $name="BtnTagListops" btntext="Do this now" add-remove="ToDoNow
-ToDo" tooltip=<<tt>>/>
</$wikify>
\end
In the second script (calling macro, the correct $name="BtnTagListops"
instead of teBtnTagListops.
Cheers
Mohammad
On Sunday, August 5, 2018 at 5:40:19 PM UTC+4:30, Thomas Elmiger wrote:
>
> Hi folks,
>
> I use the fabulous listops action for this (a bit complicated but
> reusable):
>
> \define BtnTagListops(btntext,add-remove,tooltip)
> <$button tooltip="""$tooltip$""">
> <$wikify name="timestampState" text="{{$:/config/TimestampDisable}}">
> <$action-setfield $tiddler="$:/config/TimestampDisable" $value="yes"/>
> <$action-listops $tags="$add-remove$" />
> $btntext$
> <$action-setfield $tiddler="$:/config/TimestampDisable"
> $value=<<timestampState>>/>
> </$wikify>
> </$button>
> \end
>
> This does change tags WITHOUT updating timestamps (it stores and restores
> the previous setting for updating timestamps). I call it from other macros
> like this one:
>
> \define todoBtnDoNow()
> <$wikify name="tt" text="switch tags">
> <$macrocall $name="teBtnTagListops" btntext="Do this now"
> add-remove="ToDoNow -ToDo" tooltip=<<tt>>/>
> </$wikify>
> \end
>
> <<todoBtnDoNow>> adds the tag ToDoNow and removes the tag with the minus
> (-) ToDo. You could add and remove as many tags as you like.
>
> These are somewhat simplified macros, I hope they still work and it is
> clear how they work.
>
> Cheers,
> Thomas
> (Back from offline vacation.)
>
>
--
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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/68581c8e-aed6-48cd-b0f2-9e62c2d8f5db%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.