BTW, what I'm working on is a tool that will let you select your text in
the view template, drag and drop it to the drop zone in the sidebar, and
automatically insert a link or transclusion into the place in the
viewtemplate where the original text occurred. In other words, it works
like excision, but without being in edit mode.
On Friday, December 18, 2020 at 8:56:10 PM UTC-8 Mark S. wrote:
> Ok, I think I'm back to "doesn't work with dropping." Might have to
> revisit tomorrow.
>
> Thanks!
>
> On Friday, December 18, 2020 at 8:28:47 PM UTC-8 TW Tones wrote:
>
>> Well here is my test on the pre-release.
>>
>> <$button>
>> <$action-setfield $tiddler="$:/savedtitle" text="" />
>> <$action-createtiddler $basetitle="Secret" $savetitle="$:/savedtitle"
>> tags="Excerpt" text="do you see me now 2?" />
>> <$action-setfield $tiddler="testtiddler" text={{$:/savedtitle}} />
>> <$action-navigate $to={{$:/savedtitle}}/>
>> Go
>> </$button>
>>
>> testtiddler: {{testtiddler}} saved title {{$:/savedtitle}} $:/savedtitle
>> [[testtiddler]]
>>
>> It seems to me to be doing what is expected of it.
>>
>> - Each time I click it generates the tiddler and updates testtiddler
>> with the current new title.
>> - So yes the $:/savedtitle is available to the second setfield.
>> - I clear the $:/savedtitle first as a demo but it is not necessary.
>>
>> Tones
>> On Saturday, 19 December 2020 at 15:10:08 UTC+11 Mark S. wrote:
>>
>>> Ok, the navigation actually occurs AFTER the entire routine has
>>> finished. Inside the routine, the value of the saved tiddler is unavailable.
>>>
>>> To see this, try this variation:
>>>
>>> <$button>
>>> <$action-createtiddler $basetitle="Secret" $savetitle="$:/savedtitle"
>>> tags="Excerpt" text="do you see me now 2?" />
>>> <$action-setfield $tiddler="testtiddler" text={{$:/savedtitle}} />
>>> <$action-navigate $to={{$:/savedtitle}}/>
>>> Go
>>> </$button>
>>>
>>> testtiddler: {{testtiddler}}
>>>
>>> When you press go, the contents of testtiddler will be the *prior* (if
>>> there were any) contents of $:/savedtitle, not the one's generated during
>>> the routine.
>>>
>>>
>>> On Friday, December 18, 2020 at 6:24:11 PM UTC-8 TW Tones wrote:
>>>
>>>> Folks,
>>>>
>>>> I may be missing something here, or perhaps 5.1.23 has reverted
>>>> (untested by me yet), but I cant help but feel these posts are
>>>> miss-representing things somehow.
>>>>
>>>> The drop actions do add complexity to this but inside a single button I
>>>> have used createtiddler then referenced the save title as a variable and
>>>> used it elsewhere.
>>>> However if one determines a base title that does not exist yet, then
>>>> the save title will always be the same and you don't even need to access
>>>> it. Just use the first title to used for base title. If multiple tiddlers
>>>> are written they should receive a number increment tiddlername 1,
>>>> tiddlername 2 etc... in which case they all have the prefix tiddlername.
>>>> Knowing this if you want you can rename them.
>>>>
>>>> In the pre-release
>>>> <$button>
>>>> <$action-createtiddler $basetitle="Excerpt" $savetitle="$:/savedtitle"
>>>> tags="Excerpt" text=<<actionText>> />
>>>> <$action-navigate $to={{$:/savedtitle}}/>
>>>> Go
>>>> </$button>
>>>>
>>>> This works, and it can only do so if the $:/savedtitle is correct when
>>>> the action-navigate is done.
>>>> So how can the OT of marks say? *The title saved in $:/savetitle
>>>> doesn't become available until AFTER the routine it is in finishes. This
>>>> means it is too late to be used by other widgets inside of the same
>>>> routine/macro.*
>>>> If becomes available immediately after the createTiddler action how can
>>>> this be true?
>>>>
>>>> Tones
>>>>
>>>>
>>>> On Friday, 18 December 2020 at 17:02:34 UTC+11 [email protected] wrote:
>>>>
>>>>> The problem is highlighted by something like this:
>>>>>
>>>>> \define dropaction()
>>>>> <$action-createtiddler $basetitle=<<actionTiddler>> />
>>>>> <$list
>>>>> filter="[all[tiddlers]search:title<actionTiddler>sort[created]last[]]"
>>>>> variable="lastcreated">
>>>>> <$fieldmangler tiddler=<<lastcreated>>>
>>>>> <$action-sendmessage $message="tm-add-tag" $param=<<currentTiddler>>/>
>>>>> </$fieldmangler>
>>>>> </$list>
>>>>> \end
>>>>>
>>>>> <$droppable actions=<<dropaction>>>Some area to drop on
>>>>> </$droppable>
>>>>>
>>>>> ... this brute-force approach doesn't work and will tag the second
>>>>> from last one since the action-createtiddler doesn't create a tiddler
>>>>> until
>>>>> the entire action is done.
>>>>>
>>>>> None of these work now but maybe one of these solutions could be
>>>>> adopted in the core:
>>>>> 1) the DroppableWidget could be made to act more like the ButtonWidget
>>>>> in that actions within the widget are triggered so <$droppable
>>>>> actions=<<second_actions>> > <<first_actions>> </$droppable> would
>>>>> work.
>>>>> Right now only <<second_actions>> trigger.
>>>>>
>>>>> 2) DroppableWidgets (and ButtonWidgets) could be make nestable with
>>>>> inner widgets completing before outer ones so that you can have
>>>>> constructs
>>>>> like:
>>>>>
>>>>> <$droppable actions=<<nth_drop_action>>>
>>>>> ...
>>>>> <$droppable actions=<<second_drop_action>>>
>>>>> <$droppable actions=<<first_drop_action>>>Some area to drop on
>>>>> </$droppable>
>>>>> </$droppable>
>>>>> ...
>>>>> </$droppable>
>>>>>
>>>>> 3) ActionCreateTiddlerWidget could have a variable scope that acts
>>>>> like <$fieldmangler> to do things like:
>>>>> <$action-createtiddler $basetitle="Created Tiddler">
>>>>>
>>>>> <<actions_that_use_currentTiddler_or_defined_variable_that_is_same_as_that_stored_in_$savetitle>>
>>>>> </$action-createtiddler>
>>>>>
>>>>> ... however having the name won't help if the tiddler isn't created
>>>>> until the end.
>>>>>
>>>>> Some potential RFEs ... none of which I have the skill to implement.
>>>>>
>>>>> /Mike
>>>>>
>>>>> On Friday, December 18, 2020 at 12:18:14 AM UTC-4 Mark S. wrote:
>>>>>
>>>>>> On Thursday, December 17, 2020 at 7:33:30 PM UTC-8 TW Tones wrote:
>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Otherwise; *accept or generate the new tiddler name before
>>>>>>> $action-createtiddler *
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> This somewhat obviates the utility of the $savetitle attribute, since
>>>>>> the results are not available until the containing process is completed.
>>>>>>
>>>>>> So, for instance, you couldn't catch use $savetitle to create a
>>>>>> reference in another tiddler to the newly created tiddler until the
>>>>>> process
>>>>>> is done. Meaning, at best, that the user has to push a button for a
>>>>>> second
>>>>>> time for no apparent reason. (not apparent to the user, in any case).
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/9af5abd3-d536-4b96-9cd3-80726d0375ffn%40googlegroups.com.