tiddlyclip icon indicating copy to clipboard operation
tiddlyclip copied to clipboard

How to snip to draft of target tiddler?

Open Marxsal opened this issue 2 years ago • 6 comments

In certain cases, it would be convenient to insert a snip into a draft of an existing tiddler rather than into the tiddler itself. For instance, if you're making other pastes or changes, then having to close the tiddler before snipping and then re-opening for editing becomes tedisome.

I tried to make a version of the defaultSnip, but changing the title name in the rule to:

Draft of '((@pageTitle))'

But this doesn't seem to work. Perhaps text can't be concatenated this way?

Marxsal avatar Mar 09 '22 22:03 Marxsal

try this

image

|!Title|!Body|!Tags|!Fields modifiers|!field initials|!Modes| | Draft of '((*@pageTitle*))'|((*@text*))|||{"$location":"((*@pageRef*))"},{"$draft.title":"((*@pageTitle*))"},{"$draft.of":"((*@pageTitle*))"}|append add|

buggyj avatar Mar 09 '22 22:03 buggyj

That doesn't seem to work either. Thanks!

Marxsal avatar Mar 10 '22 01:03 Marxsal

oops! There is a space before Draft of try

|!Title|!Body|!Tags|!Fields modifiers|!field initials|!Modes| |Draft of '((*@pageTitle*))'|((*@text*))|||{"$location":"((*@pageRef*))"},{"$draft.title":"((*@pageTitle*))"},{"$draft.of":"((*@pageTitle*))"}|append add|

buggyj avatar Mar 10 '22 02:03 buggyj

That sort of works. It adds the text, but doesn't always show it in the draft. You have to close the tiddler before it appears. I imagine it has something to do with how refresh in TW works.

Marxsal avatar Mar 10 '22 03:03 Marxsal

That would be a bug in tiddlywiki,

there is a delay for updating drafts:

https://tiddlywiki.com/#RefreshThrottling

is there any pattern to the non-showing of updates?

buggyj avatar Mar 10 '22 07:03 buggyj

The throttling thing made sense since I often have throttling times of 4 minutes or more. But in this case I still had the throttling at 400ms. The items never showed up in the edit screen. But if I had preview open, then they did show up on the preview side. Closing and re-opening preview updates the editor, as does closing and opening the tiddler. I didn't notice any pattern. Creating the draft this way is slightly dangerous, because if you don't have the draft tiddler open, you could accidentally write over your original tiddler. Now I've moved on to using userstring for my capturing.

Marxsal avatar Mar 10 '22 22:03 Marxsal