buggyj / tiddlyclip

webclipper for tiddlywikis
http://tiddlyclip.tiddlyspot.com/
MIT License
47 stars 4 forks source link

How to snip to draft of target tiddler? #71

Open Marxsal opened 2 years ago

Marxsal commented 2 years ago

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?

buggyj commented 2 years ago

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|

Marxsal commented 2 years ago

That doesn't seem to work either. Thanks!

buggyj commented 2 years ago

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|

Marxsal commented 2 years ago

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.

buggyj commented 2 years ago

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?

Marxsal commented 2 years ago

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.