How append "-foo" to a field?

98 views
Skip to first unread message

Mat

unread,
Sep 9, 2017, 9:02:26 AM9/9/17
to TiddlyWiki
For the Batch Manipulator, I need a button to append foo and [[frotz gronk]] "negatively" to an existing field value so it looks like this

foo bar [[frotz gronk]] -foo -[[frotz gronk]]

If this is then input for a filter, the result in "bar" only. But I need the above statement to exist visibly/statically in a field.

I assume I should use listops but fail to get that "negative append". Here's the code:


\define negative(...)
<$button>
   
Remove
   
<$action-listops $tiddler="mylist"  $subfilter="???????????" />
</$button>
\end

<$edit-text tiddler=mylist tag=input/
>

<<negative ... >>


The actual use for it in Batch Manipulator is to have a button next to each listed tiddler so that individual titles can be excluded from the batch manipulation.

Thank you in advance! 

<:-)

codacoder...@outlook.com

unread,
Sep 9, 2017, 9:46:05 AM9/9/17
to TiddlyWiki
Couldn't you store an exclusions list somewhere and always add it to the filter?  It starts empty... then has (in this example) -foo added.

Mat

unread,
Sep 9, 2017, 10:28:02 AM9/9/17
to TiddlyWiki
codacoder...@outlook.com wrote:
Couldn't you store an exclusions list somewhere and always add it to the filter?  It starts empty... then has (in this example) -foo added.

Thanks - but how do I add those (negative) titles to such an exclusions list? I know how to add titles to a list, but not with prefixing "-".

<:-)

Mark S.

unread,
Sep 9, 2017, 11:09:14 AM9/9/17
to TiddlyWiki
Hi Mat,

I think because you're manipulating the field like text, and not like a list, you need the action-setfield operator instead. I'm sure this example is over-simplistic, but here it goes:

\define concat() $(append2me)$ -$(appendme1)$ -$(appendme2)$  
\define negative()
<$vars append2me={{mylist!!list}} appendme1="fritz" appendme2="[[frotz gronk]]" >
<$button>
   
Remove
   
<$action-setfield $tiddler="mylist"  $field="list" $value=<<concat>> />
</
$button>
</$vars>
\end

<$edit-text tiddler=mylist tag=input/
>

<<negative ... >>

The question I would have is why you want to do it this way, and not just use the listops operator to change the list field? Also, does the elipses in <<negative ...>> do anything?

Have fun!
Mark

Mat

unread,
Sep 9, 2017, 11:16:41 AM9/9/17
to TiddlyWiki
Mark

I will try out your suggestion. Thank you!

The question I would have is why you want to do it this way, and not just use the listops operator to change the list field?

But that is exactly my question above? I.e how would I do this with the listops operator. Or do I misunderstand you? Or something else for that matter?
 

Also, does the elipses in <<negative ...>> do anything?

I meant to indicate a possible arguments list. The thing is, I didn't want to be too specific because just maybe it will work better with $(external)$ rather than $internal$ variables.

<:-)

Mark S.

unread,
Sep 9, 2017, 1:11:28 PM9/9/17
to TiddlyWiki
I understood the question, but not the motivation for the question. What I meant was, why do you need to have a static field like:

   foo
bar [[frotz gronk]] -foo -[[frotz gronk]]

rather than use listops to achieve:

   bar

??

Have fun!
Mark

Mat

unread,
Sep 9, 2017, 4:42:20 PM9/9/17
to TiddlyWiki
Regardless of me causing confusion; your solution worked great and Batch Manipulator now allows removing individual titles from the list.

Thanks Mark!

<:-)

Reply all
Reply to author
Forward
0 new messages