Re: [tw5] Re: Edit textbox to append text to another tiddler

2021-03-21 Thread dieg...@gmail.com
@Mat: You're right - I typed out a question but left most of the context in 
my head! Apologies! Saq guessed what I wanted.

@Saq: Thank you for the code and the explanation of the else! 

It might be worth adding that note about blank vs empty string as inputs to 
the next step in the filters documentation. 



On Sunday, March 21, 2021 at 7:31:08 AM UTC-5 saq.i...@gmail.com wrote:

> @Mohammad the underyling issue is one that I think we have discussed 
> before in another context.
>
> TiddlyWiki filters distinguish between no results from a filter step, and 
> an empty string as a result.
>
> When there is no result from a filter step, like with get[text] on a 
> non-existent tiddler, the next filter step receives no input and therefore 
> the entire filter run will have no output. However, by using else[] we 
> specify an empty string as the input to the next step if the previous step 
> had returned no result. This allows the addsuffix[] step to return a result.
>
> This is the same reason why we have the is[blank] operator, to distinguish 
> between no result, and an empty string as a result.
>
> On Sunday, March 21, 2021 at 11:44:51 AM UTC+1 Mohammad wrote:
>
>> Saq
>> Thank you! works like a charm!
>> Would you please explain what empty else[] does here?
>>
>>
>>
>>
>> Best wishes
>> Mohammad
>>
>>
>> On Sun, Mar 21, 2021 at 12:14 PM Saq Imtiaz  wrote:
>>
>>> Try adding an else[] after get[text]
>>>
>>> On Sunday, March 21, 2021 at 5:51:59 AM UTC+1 Mohammad wrote:
>>>
 Lovely solution Saq!

 why it does not work with a non-existent Target tiddler? how can I 
 extend the code to address this issue?


 Best wishes
 Mohammad


 On Sat, Mar 20, 2021 at 11:37 PM Saq Imtiaz  wrote:

> @Diego, this is untested code but should hopefully point you in the 
> right direction:
>
> \define appendBoxActions()
> <$action-setfield $tiddler=<> text={{{ 
> [get[text]addsuffixaddsuffixaddsuffix{$:/temp/appendbox}]
>  
> }}}/>
> <$action-setfield $tiddler="$:/temp/appendbox" text=""/>
> \end
>
> <$vars targetTiddler="Target" linebreak="
> ">
> <$keyboard key="Enter" actions=<>>
> <$edit-text tag="textarea" placeholder="" tiddler="$:/temp/appendbox"/>
> 
> 
>
> Since you are only appending on the Enter key as opposed to on every 
> keystroke, you could indeed apply this code via a viewtemplate and append 
> to the tiddler the textarea field is in, if so desired. The key is that 
> the 
> edit-text widget writes to a temp tiddler.
>
>
> On Saturday, March 20, 2021 at 8:02:54 PM UTC+1 dieg...@gmail.com 
> wrote:
>
>>
>> Hello all,
>>
>> Using Nico's projectify with the excellent quick todo add, has put me 
>> in mind for something similar.
>>
>> I'd like to have a tiddler with an edit box visible in view mode, and 
>> when I type something in that edit box and press enter, what I've typed 
>> gets *appended* to a tiddler (as I understand, cant be the tiddler 
>> Im using the edit box in), with a timestamp. 
>>
>> I know this will involve a keyboard widget. While I was trying it out 
>> myself, I got stuck trying to append.
>>
>> Has anyone done anything similar and/or willing to help?
>>
>> Thanks!
>> Diego
>>
>>
>> -- 
> 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 tiddlywiki+...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/tiddlywiki/a011af6d-89a5-4d90-bbf6-df25fc88f434n%40googlegroups.com
>  
> 
> .
>
 -- 
>>> 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 tiddlywiki+...@googlegroups.com.
>>>
>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/tiddlywiki/1f7d2e7b-c24a-4e19-8d3e-113fc6870e42n%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/87d26d94-f8d4-4db8-90ec-7d4f5c634658n%40googlegroups.com.


Re: [tw5] Re: Edit textbox to append text to another tiddler

2021-03-21 Thread Mohammad Rahmani
Hi Saq,
Many thanks for clarification
So the magic is the empty string returned by else[]

Thanks again!


On Sun, Mar 21, 2021 at 4:01 PM Saq Imtiaz  wrote:

> @Mohammad the underyling issue is one that I think we have discussed
> before in another context.
>
> TiddlyWiki filters distinguish between no results from a filter step, and
> an empty string as a result.
>
> When there is no result from a filter step, like with get[text] on a
> non-existent tiddler, the next filter step receives no input and therefore
> the entire filter run will have no output. However, by using else[] we
> specify an empty string as the input to the next step if the previous step
> had returned no result. This allows the addsuffix[] step to return a result.
>
> This is the same reason why we have the is[blank] operator, to distinguish
> between no result, and an empty string as a result.
>
> On Sunday, March 21, 2021 at 11:44:51 AM UTC+1 Mohammad wrote:
>
>> Saq
>> Thank you! works like a charm!
>> Would you please explain what empty else[] does here?
>>
>>
>>
>>
>> Best wishes
>> Mohammad
>>
>>
>> On Sun, Mar 21, 2021 at 12:14 PM Saq Imtiaz  wrote:
>>
>>> Try adding an else[] after get[text]
>>>
>>> On Sunday, March 21, 2021 at 5:51:59 AM UTC+1 Mohammad wrote:
>>>
 Lovely solution Saq!

 why it does not work with a non-existent Target tiddler? how can I
 extend the code to address this issue?


 Best wishes
 Mohammad


 On Sat, Mar 20, 2021 at 11:37 PM Saq Imtiaz  wrote:

> @Diego, this is untested code but should hopefully point you in the
> right direction:
>
> \define appendBoxActions()
> <$action-setfield $tiddler=<> text={{{
> [get[text]addsuffixaddsuffixaddsuffix{$:/temp/appendbox}]
> }}}/>
> <$action-setfield $tiddler="$:/temp/appendbox" text=""/>
> \end
>
> <$vars targetTiddler="Target" linebreak="
> ">
> <$keyboard key="Enter" actions=<>>
> <$edit-text tag="textarea" placeholder="" tiddler="$:/temp/appendbox"/>
> 
> 
>
> Since you are only appending on the Enter key as opposed to on every
> keystroke, you could indeed apply this code via a viewtemplate and append
> to the tiddler the textarea field is in, if so desired. The key is that 
> the
> edit-text widget writes to a temp tiddler.
>
>
> On Saturday, March 20, 2021 at 8:02:54 PM UTC+1 dieg...@gmail.com
> wrote:
>
>>
>> Hello all,
>>
>> Using Nico's projectify with the excellent quick todo add, has put me
>> in mind for something similar.
>>
>> I'd like to have a tiddler with an edit box visible in view mode, and
>> when I type something in that edit box and press enter, what I've typed
>> gets *appended* to a tiddler (as I understand, cant be the tiddler
>> Im using the edit box in), with a timestamp.
>>
>> I know this will involve a keyboard widget. While I was trying it out
>> myself, I got stuck trying to append.
>>
>> Has anyone done anything similar and/or willing to help?
>>
>> Thanks!
>> Diego
>>
>>
>> --
> 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 tiddlywiki+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/tiddlywiki/a011af6d-89a5-4d90-bbf6-df25fc88f434n%40googlegroups.com
> 
> .
>
 --
>>> 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 tiddlywiki+...@googlegroups.com.
>>>
>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/tiddlywiki/1f7d2e7b-c24a-4e19-8d3e-113fc6870e42n%40googlegroups.com
>>> 
>>> .
>>>
>> --
> 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 tiddlywiki+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/tiddlywiki/42fde8cf-456c-4bf1-b08d-1a7231575180n%40googlegroups.com
> 
> .
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view th

Re: [tw5] Re: Edit textbox to append text to another tiddler

2021-03-21 Thread Saq Imtiaz
@Mohammad the underyling issue is one that I think we have discussed before 
in another context.

TiddlyWiki filters distinguish between no results from a filter step, and 
an empty string as a result.

When there is no result from a filter step, like with get[text] on a 
non-existent tiddler, the next filter step receives no input and therefore 
the entire filter run will have no output. However, by using else[] we 
specify an empty string as the input to the next step if the previous step 
had returned no result. This allows the addsuffix[] step to return a result.

This is the same reason why we have the is[blank] operator, to distinguish 
between no result, and an empty string as a result.

On Sunday, March 21, 2021 at 11:44:51 AM UTC+1 Mohammad wrote:

> Saq
> Thank you! works like a charm!
> Would you please explain what empty else[] does here?
>
>
>
>
> Best wishes
> Mohammad
>
>
> On Sun, Mar 21, 2021 at 12:14 PM Saq Imtiaz  wrote:
>
>> Try adding an else[] after get[text]
>>
>> On Sunday, March 21, 2021 at 5:51:59 AM UTC+1 Mohammad wrote:
>>
>>> Lovely solution Saq!
>>>
>>> why it does not work with a non-existent Target tiddler? how can I 
>>> extend the code to address this issue?
>>>
>>>
>>> Best wishes
>>> Mohammad
>>>
>>>
>>> On Sat, Mar 20, 2021 at 11:37 PM Saq Imtiaz  wrote:
>>>
 @Diego, this is untested code but should hopefully point you in the 
 right direction:

 \define appendBoxActions()
 <$action-setfield $tiddler=<> text={{{ 
 [get[text]addsuffixaddsuffixaddsuffix{$:/temp/appendbox}]
  
 }}}/>
 <$action-setfield $tiddler="$:/temp/appendbox" text=""/>
 \end

 <$vars targetTiddler="Target" linebreak="
 ">
 <$keyboard key="Enter" actions=<>>
 <$edit-text tag="textarea" placeholder="" tiddler="$:/temp/appendbox"/>
 
 

 Since you are only appending on the Enter key as opposed to on every 
 keystroke, you could indeed apply this code via a viewtemplate and append 
 to the tiddler the textarea field is in, if so desired. The key is that 
 the 
 edit-text widget writes to a temp tiddler.


 On Saturday, March 20, 2021 at 8:02:54 PM UTC+1 dieg...@gmail.com 
 wrote:

>
> Hello all,
>
> Using Nico's projectify with the excellent quick todo add, has put me 
> in mind for something similar.
>
> I'd like to have a tiddler with an edit box visible in view mode, and 
> when I type something in that edit box and press enter, what I've typed 
> gets *appended* to a tiddler (as I understand, cant be the tiddler Im 
> using the edit box in), with a timestamp. 
>
> I know this will involve a keyboard widget. While I was trying it out 
> myself, I got stuck trying to append.
>
> Has anyone done anything similar and/or willing to help?
>
> Thanks!
> Diego
>
>
> -- 
 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 tiddlywiki+...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/tiddlywiki/a011af6d-89a5-4d90-bbf6-df25fc88f434n%40googlegroups.com
  
 
 .

>>> -- 
>> 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 tiddlywiki+...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/tiddlywiki/1f7d2e7b-c24a-4e19-8d3e-113fc6870e42n%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/42fde8cf-456c-4bf1-b08d-1a7231575180n%40googlegroups.com.


Re: [tw5] Re: Edit textbox to append text to another tiddler

2021-03-21 Thread Mohammad Rahmani
Saq
Thank you! works like a charm!
Would you please explain what empty else[] does here?




Best wishes
Mohammad


On Sun, Mar 21, 2021 at 12:14 PM Saq Imtiaz  wrote:

> Try adding an else[] after get[text]
>
> On Sunday, March 21, 2021 at 5:51:59 AM UTC+1 Mohammad wrote:
>
>> Lovely solution Saq!
>>
>> why it does not work with a non-existent Target tiddler? how can I extend
>> the code to address this issue?
>>
>>
>> Best wishes
>> Mohammad
>>
>>
>> On Sat, Mar 20, 2021 at 11:37 PM Saq Imtiaz  wrote:
>>
>>> @Diego, this is untested code but should hopefully point you in the
>>> right direction:
>>>
>>> \define appendBoxActions()
>>> <$action-setfield $tiddler=<> text={{{
>>> [get[text]addsuffixaddsuffixaddsuffix{$:/temp/appendbox}]
>>> }}}/>
>>> <$action-setfield $tiddler="$:/temp/appendbox" text=""/>
>>> \end
>>>
>>> <$vars targetTiddler="Target" linebreak="
>>> ">
>>> <$keyboard key="Enter" actions=<>>
>>> <$edit-text tag="textarea" placeholder="" tiddler="$:/temp/appendbox"/>
>>> 
>>> 
>>>
>>> Since you are only appending on the Enter key as opposed to on every
>>> keystroke, you could indeed apply this code via a viewtemplate and append
>>> to the tiddler the textarea field is in, if so desired. The key is that the
>>> edit-text widget writes to a temp tiddler.
>>>
>>>
>>> On Saturday, March 20, 2021 at 8:02:54 PM UTC+1 dieg...@gmail.com wrote:
>>>

 Hello all,

 Using Nico's projectify with the excellent quick todo add, has put me
 in mind for something similar.

 I'd like to have a tiddler with an edit box visible in view mode, and
 when I type something in that edit box and press enter, what I've typed
 gets *appended* to a tiddler (as I understand, cant be the tiddler Im
 using the edit box in), with a timestamp.

 I know this will involve a keyboard widget. While I was trying it out
 myself, I got stuck trying to append.

 Has anyone done anything similar and/or willing to help?

 Thanks!
 Diego


 --
>>> 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 tiddlywiki+...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/tiddlywiki/a011af6d-89a5-4d90-bbf6-df25fc88f434n%40googlegroups.com
>>> 
>>> .
>>>
>> --
> 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 tiddlywiki+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/tiddlywiki/1f7d2e7b-c24a-4e19-8d3e-113fc6870e42n%40googlegroups.com
> 
> .
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/CAAV1gMDY8e6DVv%3Dvp%3D2Kz0hYivZBsYPYBm_-PfXUa9QSmvE1ig%40mail.gmail.com.


Re: [tw5] Re: Edit textbox to append text to another tiddler

2021-03-21 Thread Saq Imtiaz
Try adding an else[] after get[text]

On Sunday, March 21, 2021 at 5:51:59 AM UTC+1 Mohammad wrote:

> Lovely solution Saq!
>
> why it does not work with a non-existent Target tiddler? how can I extend 
> the code to address this issue?
>
>
> Best wishes
> Mohammad
>
>
> On Sat, Mar 20, 2021 at 11:37 PM Saq Imtiaz  wrote:
>
>> @Diego, this is untested code but should hopefully point you in the right 
>> direction:
>>
>> \define appendBoxActions()
>> <$action-setfield $tiddler=<> text={{{ 
>> [get[text]addsuffixaddsuffixaddsuffix{$:/temp/appendbox}]
>>  
>> }}}/>
>> <$action-setfield $tiddler="$:/temp/appendbox" text=""/>
>> \end
>>
>> <$vars targetTiddler="Target" linebreak="
>> ">
>> <$keyboard key="Enter" actions=<>>
>> <$edit-text tag="textarea" placeholder="" tiddler="$:/temp/appendbox"/>
>> 
>> 
>>
>> Since you are only appending on the Enter key as opposed to on every 
>> keystroke, you could indeed apply this code via a viewtemplate and append 
>> to the tiddler the textarea field is in, if so desired. The key is that the 
>> edit-text widget writes to a temp tiddler.
>>
>>
>> On Saturday, March 20, 2021 at 8:02:54 PM UTC+1 dieg...@gmail.com wrote:
>>
>>>
>>> Hello all,
>>>
>>> Using Nico's projectify with the excellent quick todo add, has put me in 
>>> mind for something similar.
>>>
>>> I'd like to have a tiddler with an edit box visible in view mode, and 
>>> when I type something in that edit box and press enter, what I've typed 
>>> gets *appended* to a tiddler (as I understand, cant be the tiddler Im 
>>> using the edit box in), with a timestamp. 
>>>
>>> I know this will involve a keyboard widget. While I was trying it out 
>>> myself, I got stuck trying to append.
>>>
>>> Has anyone done anything similar and/or willing to help?
>>>
>>> Thanks!
>>> Diego
>>>
>>>
>>> -- 
>> 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 tiddlywiki+...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/tiddlywiki/a011af6d-89a5-4d90-bbf6-df25fc88f434n%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/1f7d2e7b-c24a-4e19-8d3e-113fc6870e42n%40googlegroups.com.


Re: [tw5] Re: Edit textbox to append text to another tiddler

2021-03-20 Thread Mohammad Rahmani
Lovely solution Saq!

why it does not work with a non-existent Target tiddler? how can I extend
the code to address this issue?


Best wishes
Mohammad


On Sat, Mar 20, 2021 at 11:37 PM Saq Imtiaz  wrote:

> @Diego, this is untested code but should hopefully point you in the right
> direction:
>
> \define appendBoxActions()
> <$action-setfield $tiddler=<> text={{{
> [get[text]addsuffixaddsuffixaddsuffix{$:/temp/appendbox}]
> }}}/>
> <$action-setfield $tiddler="$:/temp/appendbox" text=""/>
> \end
>
> <$vars targetTiddler="Target" linebreak="
> ">
> <$keyboard key="Enter" actions=<>>
> <$edit-text tag="textarea" placeholder="" tiddler="$:/temp/appendbox"/>
> 
> 
>
> Since you are only appending on the Enter key as opposed to on every
> keystroke, you could indeed apply this code via a viewtemplate and append
> to the tiddler the textarea field is in, if so desired. The key is that the
> edit-text widget writes to a temp tiddler.
>
>
> On Saturday, March 20, 2021 at 8:02:54 PM UTC+1 dieg...@gmail.com wrote:
>
>>
>> Hello all,
>>
>> Using Nico's projectify with the excellent quick todo add, has put me in
>> mind for something similar.
>>
>> I'd like to have a tiddler with an edit box visible in view mode, and
>> when I type something in that edit box and press enter, what I've typed
>> gets *appended* to a tiddler (as I understand, cant be the tiddler Im
>> using the edit box in), with a timestamp.
>>
>> I know this will involve a keyboard widget. While I was trying it out
>> myself, I got stuck trying to append.
>>
>> Has anyone done anything similar and/or willing to help?
>>
>> Thanks!
>> Diego
>>
>>
>> --
> 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 tiddlywiki+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/tiddlywiki/a011af6d-89a5-4d90-bbf6-df25fc88f434n%40googlegroups.com
> 
> .
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/CAAV1gMAUVPFTH3Tqdfb2526nF%2B%2BFoQvrr711y6J1i%3DTbP9ZQ6Q%40mail.gmail.com.