[tw5] Macro to set a field value in multiple tiddlers

2019-05-18 Thread Damon Pritchett
Hello once again,

I would like to create a macro that will filter my nearly 2,000 tiddlers by 
tag, field or both and then add a new field and its value to each tiddler 
that matches the filter result. This seems very doable, but given my lack 
of macro experience, I'm not really sure how to start. Has anyone ever done 
this before or have something close that I could build off of?

Thanks in advance.

Cheers,

Damon

-- 
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 post to this group, send email to tiddlywiki@googlegroups.com.
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/c143e289-1846-4028-9ed6-e2d0146530e1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: Toggle a tag when pressing button to reveal text

2019-05-18 Thread Ed Edson
Thank you for your reply.

I added the action-sendmessage widget and weirdly it works when I try it in 
the preview pane but not once I have saved the tiddler...

Here is what I tried in full:

<$reveal type="nomatch" state="$:/state/SampleReveal2" text="show">

<$button set="$:/state/SampleReveal2" setTo="show">
<$action-sendmessage $message="tm-add-tag" $param="tagname"/>
Show me



<$reveal type="match" state="$:/state/SampleReveal2" text="show">

<$button set="$:/state/SampleReveal2" setTo="hide">
<$action-sendmessage $message="tm-remove-tag" $param="tagname"/>
Hide me


! This is the revealed content
And this is some text





On Sunday, May 19, 2019 at 1:55:14 AM UTC+1, TonyM wrote:
>
> Place these (untested) after the <$button> or the variation within the button 
> definition itself.
>
> Tiddler is not specified making it apply to the currentTiddler
>
>
> Tag method
>
> <$action-sendmessage $message="tm-add-tag" $param="tagname"/>
> or
> <$action-sendmessage $message="tm-remove-tag" $param="tagname"/>
>
>
>
> Field method
>
> <$action-setfield $field="fieldname" text="show"/>
> Or
> <$action-setfield $field="fieldname" text="hide"/>
>
> Regards
> Tony
>
>
> On Sunday, May 19, 2019 at 10:35:59 AM UTC+10, TonyM wrote:
>>
>> A quick answer is to add an action to each button that adds or removes 
>> the required tag.
>>
>> Personally I prefer setting the reveal state to a value in a field on the 
>> current tiddler so as to not over burden the tags.
>>
>> Regards
>> Tony
>>
>>

-- 
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 post to this group, send email to tiddlywiki@googlegroups.com.
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/bbb5b7b4-ab5e-4a7c-8be5-d23da4387c66%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: Adding tags containing spaces when creating a child tiddler

2019-05-18 Thread passingby
That worked. Thanks Mark!

On Saturday, May 18, 2019 at 6:03:35 PM UTC-7, Mark S. wrote:
>
> Maybe someone will have a more elegant solution, but this appears to work:
>
> \define wraptitle() [[$(currentTiddler)$]]
> <$button>
> Add child tiddler
> <$action-sendmessage $message="tm-new-tiddler"  tags=<> />
> 
>
>
> On Saturday, May 18, 2019 at 4:59:49 PM UTC-7, passingby wrote:
>>
>> I am trying to create a child tiddler of a journal by attaching the name 
>> of the journal tiddler as a tag along with other tags. But it does not seem 
>> to work out.
>>
>>  I have tried this:
>> <$button>
>> Add child tiddler
>> <$action-sendmessage $message="tm-new-tiddler"  tags=<> />
>> 
>>
>> But this add three separate tags like 81th, 2019, May
>>
>> then I tried this:
>>
>> <$button>
>> Add child tiddler
>> <$wikify name="tidtags" text="[[<>]] anothertag">
>> <$action-sendmessage $message="tm-new-tiddler" tags=<> />
>> 
>> 
>>
>> This results in two tags <> (literal) and anothertag. Not 
>> what I want.
>>
>> Any ideas?
>>
>>
>>
>>
>>

-- 
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 post to this group, send email to tiddlywiki@googlegroups.com.
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/69faa918-45ea-4442-ac55-bb0327d013b5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: Toggle a tag when pressing button to reveal text

2019-05-18 Thread Ed Edson
Thank you! Exactly what I needed!

On Sunday, May 19, 2019 at 1:55:14 AM UTC+1, TonyM wrote:
>
> Place these (untested) after the <$button> or the variation within the button 
> definition itself.
>
> Tiddler is not specified making it apply to the currentTiddler
>
>
> Tag method
>
> <$action-sendmessage $message="tm-add-tag" $param="tagname"/>
> or
> <$action-sendmessage $message="tm-remove-tag" $param="tagname"/>
>
>
>
> Field method
>
> <$action-setfield $field="fieldname" text="show"/>
> Or
> <$action-setfield $field="fieldname" text="hide"/>
>
> Regards
> Tony
>
>
> On Sunday, May 19, 2019 at 10:35:59 AM UTC+10, TonyM wrote:
>>
>> A quick answer is to add an action to each button that adds or removes 
>> the required tag.
>>
>> Personally I prefer setting the reveal state to a value in a field on the 
>> current tiddler so as to not over burden the tags.
>>
>> Regards
>> Tony
>>
>>

-- 
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 post to this group, send email to tiddlywiki@googlegroups.com.
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/18f5e4eb-cd36-4b2a-9ba3-d8934490e6bd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: a list of all the in-built css classes?

2019-05-18 Thread 'Mark S.' via TiddlyWiki
Yes it would be bigger. You would need to strip off the initial period and 
then use it in a regular expression like:

class=".*\b.*"

Where the quotes are literal. I suspect the output would be overwhelming -- 
certain classes are used in every tiddler. So, maybe what to run on a 
nearly-empty tw file?


On Friday, May 17, 2019 at 8:01:38 PM UTC-7, TonyM wrote:
>
> Mark
>
> I will check this out but have you noticed a way to identify where they 
> are used in the ui?
>
> this seems to be the bigger challenge.
>
> Tony
>
>

-- 
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 post to this group, send email to tiddlywiki@googlegroups.com.
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/a108cf4f-4029-48d6-ad9f-2dd0882b5de2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: Adding tags containing spaces when creating a child tiddler

2019-05-18 Thread 'Mark S.' via TiddlyWiki
Maybe someone will have a more elegant solution, but this appears to work:

\define wraptitle() [[$(currentTiddler)$]]
<$button>
Add child tiddler
<$action-sendmessage $message="tm-new-tiddler"  tags=<> />



On Saturday, May 18, 2019 at 4:59:49 PM UTC-7, passingby wrote:
>
> I am trying to create a child tiddler of a journal by attaching the name 
> of the journal tiddler as a tag along with other tags. But it does not seem 
> to work out.
>
>  I have tried this:
> <$button>
> Add child tiddler
> <$action-sendmessage $message="tm-new-tiddler"  tags=<> />
> 
>
> But this add three separate tags like 81th, 2019, May
>
> then I tried this:
>
> <$button>
> Add child tiddler
> <$wikify name="tidtags" text="[[<>]] anothertag">
> <$action-sendmessage $message="tm-new-tiddler" tags=<> />
> 
> 
>
> This results in two tags <> (literal) and anothertag. Not 
> what I want.
>
> Any ideas?
>
>
>
>
>

-- 
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 post to this group, send email to tiddlywiki@googlegroups.com.
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/6dee8c57-d864-4ee0-90ea-a09ccae36b3a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: Toggle a tag when pressing button to reveal text

2019-05-18 Thread TonyM


Place these (untested) after the <$button> or the variation within the button 
definition itself.

Tiddler is not specified making it apply to the currentTiddler


Tag method

<$action-sendmessage $message="tm-add-tag" $param="tagname"/>
or
<$action-sendmessage $message="tm-remove-tag" $param="tagname"/>



Field method

<$action-setfield $field="fieldname" text="show"/>
Or
<$action-setfield $field="fieldname" text="hide"/>

Regards
Tony


On Sunday, May 19, 2019 at 10:35:59 AM UTC+10, TonyM wrote:
>
> A quick answer is to add an action to each button that adds or removes the 
> required tag.
>
> Personally I prefer setting the reveal state to a value in a field on the 
> current tiddler so as to not over burden the tags.
>
> Regards
> Tony
>
>

-- 
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 post to this group, send email to tiddlywiki@googlegroups.com.
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/3933a0d6-3313-4cbd-b726-f35dbf488adb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Toggle a tag when pressing button to reveal text

2019-05-18 Thread TonyM
A quick answer is to add an action to each button that adds or removes the 
required tag.

Personaly I prefer setting the reveal state to a value in a field on the 
current tiddler so as to not over burden the tags.

Regards
Tony

-- 
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 post to this group, send email to tiddlywiki@googlegroups.com.
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/17a32429-8608-47a9-aa08-e81fa13d7217%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Adding tags containing spaces when creating a child tiddler

2019-05-18 Thread passingby
I am trying to create a child tiddler of a journal by attaching the name of 
the journal tiddler as a tag along with other tags. But it does not seem to 
work out.

 I have tried this:
<$button>
Add child tiddler
<$action-sendmessage $message="tm-new-tiddler"  tags=<> />


But this add three separate tags like 81th, 2019, May

then I tried this:

<$button>
Add child tiddler
<$wikify name="tidtags" text="[[<>]] anothertag">
<$action-sendmessage $message="tm-new-tiddler" tags=<> />



This results in two tags <> (literal) and anothertag. Not 
what I want.

Any ideas?




-- 
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 post to this group, send email to tiddlywiki@googlegroups.com.
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/aead053d-ff3e-49a3-841b-66368d989daf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Add a tag when pressing button to reveal Tiddler

2019-05-18 Thread Ed Edson
New to TW, this is a basic question but I can't seem to figure it out.

I am using the reveal widget in a way very similar to the example in the 
docs:

<$reveal type="nomatch" state="$:/state/SampleReveal2" text="show">

<$button set="$:/state/SampleReveal2" setTo="show">Show me


<$reveal type="match" state="$:/state/SampleReveal2" text="show">

<$button set="$:/state/SampleReveal2" setTo="hide">Hide me

! This is the revealed content
And this is some text




I would like to add a tag to the current tiddler when the text is revealed, 
and remove it when it is hidden.

Is the a way to modify the above to add this functionality?

Thanks for your help!

-- 
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 post to this group, send email to tiddlywiki@googlegroups.com.
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/5e5935c4-879f-456b-994e-4f0a6ce436e0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: Open a tiddler or create if it does not exist

2019-05-18 Thread passingby
As an update I have decided to not to use modals, and use the natural 
tiddlywiki flow by using the zoomin story view instead. I want to make 
something that works in all the ways not just depend on modals. 

On Saturday, May 18, 2019 at 9:03:36 AM UTC-7, passingby wrote:
>
>
>
> On Saturday, May 18, 2019 at 5:09:58 AM UTC-7, TonyM wrote:
>>
>> Passingby
>>
>> The following may be obvious but worth remembering.
>>
>> If you have no need to use a template or apply tags to create a new 
>> tidder, a simple link even [[new tiddler]] is enough. The new here button 
>> helps create tiddlers tagged with the current of course. 
>>
>> but all the sophisticated options are available and I can help with those 
>> as I have studied them.
>>
>> Regards
>> Tony
>>
>
> Tony,
>
> Thank you for your input. What I am trying to accomplish is create a food 
> journal for personal health issues. The target is to record everything I 
> eat or drink and record the symptoms that follow. The general idea is 
> create a journal tiddler. It should have a custom view template which 
> displays a kind of a menu with buttons in which I can create child tiddlers 
> such as events: breakfast/lunch/dinner/snack, drink, medication/supplement, 
> exercise/yoga/, Stress, Sleep. And then outcomes: physical symptoms, energy 
> level, mood, main thoughts(spiritual/job-related/creativity-related etc). 
>
> I was thinking I should have the child tiddlers such as events and 
> outcomes show up in a modal state. They should have a simple and minimal 
> layout with all the fields being displayed. Then there should (preferably) 
> be to buttons to either cancel or confirm the data change.
>
> In order to create a view template in which fields can be displayed I am 
> taking help from technique used by http://tw5magick.tiddlyspot.com/ in 
> the tiddler [[Creating a simple Contacts DB]]. I have tiddler which shows a 
> form whose fields are linked with the child tiddler. The name of the child 
> tiddler is picked up from another tiddler something like $:/_temp/meal. So 
> the way it happens is that whenever the button is pressed on the journal to 
> show a child tiddler, the name of that child is saved into  $:/_temp/meal 
> and then the form tiddler is shown in a modal. The form tiddler then shows 
> up the data because its fields are picking up the name from  $:/_temp/meal.
>
> The problem right now is whether it is possible to have a save/cancel 
> mechanism on the form tiddler. I don't think this is possible because in 
> this process the actuall child tiddler is not being put into an edit mode 
> and the tm-edit-tiddler event is not being fired and therefore 
> tm-cancel-tiddler cannot be used. So this is the problem right now.
>
> If I think about not taking this path but showing the actual child tiddler 
> in an edit mode, then I do not know how to change the editTemplate as to 
> per my taste. Because what I want in that is, have a clean simple form and 
> 2 buttons with cancel or confirm operations.
> So this is where I am at. Any suggestions or pointers or even a different 
> approach altogether is welcome.
>
>
>

-- 
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 post to this group, send email to tiddlywiki@googlegroups.com.
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/bbb50678-82df-49f7-bd4b-4731550e1e53%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: Open a tiddler or create if it does not exist

2019-05-18 Thread passingby


On Saturday, May 18, 2019 at 5:09:58 AM UTC-7, TonyM wrote:
>
> Passingby
>
> The following may be obvious but worth remembering.
>
> If you have no need to use a template or apply tags to create a new 
> tidder, a simple link even [[new tiddler]] is enough. The new here button 
> helps create tiddlers tagged with the current of course. 
>
> but all the sophisticated options are available and I can help with those 
> as I have studied them.
>
> Regards
> Tony
>

Tony,

Thank you for your input. What I am trying to accomplish is create a food 
journal for personal health issues. The target is to record everything I 
eat or drink and record the symptoms that follow. The general idea is 
create a journal tiddler. It should have a custom view template which 
displays a kind of a menu with buttons in which I can create child tiddlers 
such as events: breakfast/lunch/dinner/snack, drink, medication/supplement, 
exercise/yoga/, Stress, Sleep. And then outcomes: physical symptoms, energy 
level, mood, main thoughts(spiritual/job-related/creativity-related etc). 

I was thinking I should have the child tiddlers such as events and outcomes 
show up in a modal state. They should have a simple and minimal layout with 
all the fields being displayed. Then there should (preferably) be to 
buttons to either cancel or confirm the data change.

In order to create a view template in which fields can be displayed I am 
taking help from technique used by http://tw5magick.tiddlyspot.com/ in the 
tiddler [[Creating a simple Contacts DB]]. I have tiddler which shows a 
form whose fields are linked with the child tiddler. The name of the child 
tiddler is picked up from another tiddler something like $:/_temp/meal. So 
the way it happens is that whenever the button is pressed on the journal to 
show a child tiddler, the name of that child is saved into  $:/_temp/meal 
and then the form tiddler is shown in a modal. The form tiddler then shows 
up the data because its fields are picking up the name from  $:/_temp/meal.

The problem right now is whether it is possible to have a save/cancel 
mechanism on the form tiddler. I don't think this is possible because in 
this process the actuall child tiddler is not being put into an edit mode 
and the tm-edit-tiddler event is not being fired and therefore 
tm-cancel-tiddler cannot be used. So this is the problem right now.

If I think about not taking this path but showing the actual child tiddler 
in an edit mode, then I do not know how to change the editTemplate as to 
per my taste. Because what I want in that is, have a clean simple form and 
2 buttons with cancel or confirm operations.
So this is where I am at. Any suggestions or pointers or even a different 
approach altogether is welcome.


-- 
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 post to this group, send email to tiddlywiki@googlegroups.com.
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/be5fc2e1-3f9a-4f31-aadc-cb9909304a77%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: Open a tiddler or create if it does not exist

2019-05-18 Thread TonyM
Passingby

The following may be obvious but worth remembering.

If you have no need to use a template or apply tags to create a new tidder, a 
simple link even [[new tiddler]] is enough. The new here button helps create 
tiddlers tagged with the current of course. 

but all the sophisticated options are available and I can help with those as I 
have studied them.

Regards
Tony

-- 
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 post to this group, send email to tiddlywiki@googlegroups.com.
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/04a511d4-6d62-43ce-8184-348f47a8075c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.