[tw] Re: Using Macro Substitution as a filter parameter

2015-02-25 Thread Alan Finger
Got it. How can I pass variable data to a Javascript macro, then? Alan On Wednesday, February 25, 2015 at 3:53:02 AM UTC-5, Astrid Elocson wrote: Hi Alan, Macro parameters are *not* parsed as WikiText until they are returned to a WikiText context. They're just inert strings of characters.

[tw] Re: Using Macro Substitution as a filter parameter

2015-02-25 Thread Jed Carty
The $macrocall widget should do what you want. It is supposed to evaluate inputs before passing them to a macro. Alternately you can use set widgets and macros: \define thisMacro() javascriptmacro $(macroinput)$ \end $set name=macroinput value=somevalue thisMacro /$set This should

[tw] Re: Using Macro Substitution as a filter parameter

2015-02-25 Thread Astrid Elocson
Hi Alan, Macro parameters are *not* parsed as WikiText until they are returned to a WikiText context. They're just inert strings of characters. This means your JavaScript is receiving strings that start with *{{* and end with *}}*. Only once the macro call has returned will its result be

[tw] Re: Using Macro Substitution as a filter parameter

2015-02-24 Thread Alan Finger
Hi Tobias, I'm finally getting back to this. Here's a simple Javascript macro that displays the value of three parameters and the results of a comparison to a constant: /** * Created by afinger on 2/24/2015. */ /* Macro to build search string from section and company parameters */

[tw] Re: Using Macro Substitution as a filter parameter

2015-01-28 Thread Alan Finger
I mean that the operator section{$:/temp/findby!!section} should only be applied to the filter if the field value is not Any I'll try to post an example in the next day or so. Alan On Wednesday, January 28, 2015 at 2:43:44 AM UTC-5, Stephan Hradek wrote: Am Mittwoch, 28. Januar 2015

[tw] Re: Using Macro Substitution as a filter parameter

2015-01-28 Thread Tobias Beer
Thanks, Jed, That's a cool example If you know what the filters will be you can use the select widget to set a field to the entire filter string and use a text reference for the filters. Added here: filter from field @ filters http://filters.tiddlyspot.com/#filter%20from%20field. Best

[tw] Re: Using Macro Substitution as a filter parameter

2015-01-28 Thread Alan Finger
That works well for one variable. The problem is that I have two: section and sourcedoc so I need to try to get concatenation working. Alan On Wednesday, January 28, 2015 at 9:02:17 AM UTC-5, Tobias Beer wrote: Thanks, Jed, That's a cool example If you know what the filters will be

[tw] Re: Using Macro Substitution as a filter parameter

2015-01-28 Thread Tobias Beer
Looks like a good place to use a javascript macro... That may indeed be a viable way to achieve this... *#1427 allow text-references and variables anywhere in a filter expression* https://github.com/Jermolene/TiddlyWiki5/issues/1427 @Jeremy, (how) can a js macro acces a variable number of

[tw] Re: Using Macro Substitution as a filter parameter

2015-01-27 Thread Stephan Hradek
Could you please post a fully (non-)working example? I have difficulties in understanding what you're trying to do by just looking at an image. I'd prefer to be able to play around a bit with real data and not try to make up test data which I made up on my own and which need not match what you

[tw] Re: Using Macro Substitution as a filter parameter

2015-01-27 Thread Stephan Hradek
Am Mittwoch, 28. Januar 2015 08:42:13 UTC+1 schrieb Stephan Hradek: Could you please post a fully (non-)working example? I have difficulties in understanding what you're trying to do by just looking at an image. I'd prefer to be able to play around a bit with real data and not try to make

[tw] Re: Using Macro Substitution as a filter parameter

2015-01-27 Thread Alan Finger
Thanks for some good ideas! I may be missing it but is there a way to set the value of a field programmatically? The action-setfield widget only works inside a button. On Tuesday, January 27, 2015 at 11:26:43 PM UTC-5, Jed Carty wrote: If you know what the filters will be you can use the

[tw] Re: Using Macro Substitution as a filter parameter

2015-01-27 Thread Jed Carty
If you know what the filters will be you can use the select widget to set a field to the entire filter string and use a text reference for the filters. $select field='filter_field' option value='[!is[tag]!is[system]]'Some name/option option value='[!is[tag]!is[system]]'Another name/option

[tw] Re: Using Macro Substitution as a filter parameter

2015-01-27 Thread Tobias Beer
You (currently) need to use variables in filters like so... [field-foovariable-bar] not... [field-foo[variable-bar]] or... [field-foovariable-bar] For more on parameters and variables, see... http://pv5.tiddlyspot.com Best wishes, Tobias. -- You received this message because you are

[tw] Re: Using Macro Substitution as a filter parameter

2015-01-27 Thread Alan Finger
Hi Tobias, I don't think that's going to work for me as I want to conditionally include entire filter operators in the filter. Depending the content of some fields (Any means no filter), i want to get [!is[tag]!is[system]] [!is[tag]!is[system][field1[value1]]