[tw5] Re: Simple check: if a tiddler-A exists do this if not then do that

2018-08-12 Thread Mohammad
Thank you both (Mark and Tony!). I understood that way I can pass complex names and values like myTids/itsname or name'extet Mohammad On Saturday, August 11, 2018 at 2:36:36 AM UTC+4:30, Mark S. wrote: > > I could give a sophisticated answer but really it's mostly because it's > what I've seen

[tw5] Re: Simple check: if a tiddler-A exists do this if not then do that

2018-08-10 Thread TonyM
Mohammad, I am not sure if this adds to the conversation but *a tiddler existence test can be written in a filter as follows* [[other]has:field[text]] where the tiddler is called other and has content in the text field or any other field you know has a value [[other]has:field[fieldname]] Inte

[tw5] Re: Simple check: if a tiddler-A exists do this if not then do that

2018-08-10 Thread 'Mark S.' via TiddlyWiki
I could give a sophisticated answer but really it's mostly because it's what I've seen in other people's code. Monkey see -- monkey code. -- Mark On Friday, August 10, 2018 at 12:39:41 PM UTC-7, Mohammad wrote: > > Mark one question: > In both solution you proposed you put the filter and tiddler

[tw5] Re: Simple check: if a tiddler-A exists do this if not then do that

2018-08-10 Thread Mohammad
Mark one question: In both solution you proposed you put the filter and tiddler parameters inside triple quotes when you pass them again to another macro or widget! Whats the reason? Mohammad On Friday, August 10, 2018 at 11:45:19 PM UTC+4:30, Mark S. wrote: > > If by "condition" you mean filter

[tw5] Re: Simple check: if a tiddler-A exists do this if not then do that

2018-08-10 Thread Mohammad
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

[tw5] Re: Simple check: if a tiddler-A exists do this if not then do that

2018-08-10 Thread 'Mark S.' via TiddlyWiki
If by "condition" you mean filter, then this works: \define if(filter,ifyes,ifno) <$list filter="""$filter$ +[limit[1]]""" name=act emptyMessage=<<$ifno$>>> <<$ifyes$>> \end \define ifyes() YES! \define ifno() NO! <> Well, it worked once ;-) You would probably need to wrap this invocation in

[tw5] Re: Simple check: if a tiddler-A exists do this if not then do that

2018-08-10 Thread Mohammad
Hello Diego! Thanks for the link! It is very close to what I want! Lets give it a try! Best Mohammad On Friday, August 10, 2018 at 11:27:12 PM UTC+4:30, Diego Mesa wrote: > > Hey Mohammad, > > Just letting you know of Evan's excellent Condition Plugin: > > http://evanbalster.com/tiddlywiki/formu

[tw5] Re: Simple check: if a tiddler-A exists do this if not then do that

2018-08-10 Thread Diego Mesa
Hey Mohammad, Just letting you know of Evan's excellent Condition Plugin: http://evanbalster.com/tiddlywiki/formulas.html#Condition%20Plugin which does that On Friday, August 10, 2018 at 1:34:04 PM UTC-5, Mohammad wrote: > > Wow! > Thank you Mark! > It works and do the job like a charm! > For

[tw5] Re: Simple check: if a tiddler-A exists do this if not then do that

2018-08-10 Thread Mohammad
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-els

[tw5] Re: Simple check: if a tiddler-A exists do this if not then do that

2018-08-10 Thread 'Mark S.' via TiddlyWiki
You can create a tiddler name in a filter, and then check if it has an actual title field. \define nontidexist(tiddler) $tiddler$ does not EXIST! \end \define tidexist(tiddler) <$vars tiddler="""$tiddler$"""> <$list filter="[title[$tiddler$]] +[has[title]]" emptyMessage=<>> $tiddler$ EXISTS. THER