At the end I use always the same url like a präfix + selected text. (see my examples)
(select text and click button or better use shortcut for the button - with a dropdown I have to do a lot more clicks)
Could it be smart? If the selection is identifiable as a URL, then prompt for the pretty link. Otherwise assume it’s already the final text and just needs a target added. Could this behavior even be rolled into the existing “Create wikitext link” button? (It would be a behavior change for it which I understand would be offputting, but if a URL is never selected then it would behave the same as it always has - and the current behavior isn’t friendly to anyone wanting to turn an existing URL in the text into a link, so I’d wonder if it’s ever used that way?)
I make use of the ctrl-L link button. Copy a full url to an internet destination. eg https://tiddlywiki.com/#Insert%20link
In the editor type the pretty link text and select it; eg “pretty link”,
my pretty link
Now press ctrl-L and ctrl-V to paste your url into the dialogue box, then hit enter,
The result will be
my [[pretty link|https://tiddlywiki.com/#Insert%20link]]
One advantage is you can insert tiddler links the same way
Another is you can just ctrl-L type a “new title” and hit enter. The result will be [[new title]] which is easier than the [[*]] button, no need to select.
The problem may be a matter of “timing” for handling the two $action-sendmessage widgets. You need to ensure that the save-selection message is completed before the wrap-selection message is invoked.
To achieve this, try moving the $action-sendmessage widgets into separate procedures, doSave and doWrap. Then, use a combination of actions=... and “inline” messages to invoke those procedures, like this:
The “inline” <<doSave>> procedure is invoked first so that the $:/temp/external-link tiddler contents are saved. Then, after that procedure has completed, the action=<<doWrap>> is invoked and can access the saved tiddler contents.
First, try this in a regular browser to see if its related to using TiddlyDesktop.
Next… and this is just a guess… try adding quotes around the action="<<doWrap>>" parameter value. This should ensure that <<doWrap>> is only being parsed when the action is triggered, and not when the $button widget is initially rendered.
Maybe it has something to do with the use of the “substituted attribute value” syntax. Try using a filtered transclusion to construct the prefix=... param, like this: