Thank you Mark!
Yes, I prefer the same! the core-based solution!
Let me to play and experiment with what you suggest then I will back with 
results.
I am not sure if all conditions can be implemented using filter or not!
We may need to ask Jeremy to improve the core capability with more robust 
and simple to understand routine!

Mohammad


On Friday, August 10, 2018 at 11:45:19 PM UTC+4:30, Mark S. wrote:
>
> If by "condition" you mean filter, then this works:
>
> \define if(filter,ifyes,ifno)
> <$list filter="""$filter$ +[limit[1]]""" name=act emptyMessage=<<$ifno$>>>
> <<$ifyes$>>
> </$list>
> \end
> \define ifyes() YES!
> \define ifno() NO!
>
>
> <<if "[title[GettingStarted]] +[has[title]]" ifyes ifno>>
>
> Well, it worked once ;-)  You would probably need to wrap this invocation 
> in another macro in order to  pass the tiddler name as a parameter.
>
> I always prefer core-based solutions if possible over 3rd party solutions, 
> since core-based solutions are more likely to stand the rigors of time.
>
> -- Mark
>
> On Friday, August 10, 2018 at 11:34:04 AM UTC-7, Mohammad wrote:
>>
>> Wow! 
>> Thank you Mark!
>> It works and do the job like a charm!
>> For action command like create tiddler I call the macro using a button!
>>
>> Much appreciated!
>>
>> Mark, one more question is it possible to have a decision making 
>> structure like below:
>>
>> If true-this
>>  macro-action-if-part
>> else
>>   macro-action-else-part
>> end if
>>
>> Then the header of macro should be something like 
>> \define dcm(cond, ifpart-action, elsepart-action)
>>
>> For checking the condition parameter to see if true or false, the setVars 
>> widget from Tobias Beer may be useful! If not we can first check the 
>> condition outside the macro and send the result (true/false) to it.
>>
>>
>> Cheers
>> Mohammad
>>
>>
>>

-- 
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/a39319f4-2c96-4262-a38e-902ac0eab189%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to