Automating the creation of active, highlighted links from unhighlighted links in exploded text with a stamp?

I have several notes I have exploded, each with many non-active URL links (links that are not highlighted )

What I want is to create a stamp that will find these links and make them active. How do I do that?

I have included an example file below with a single note with Text with multiple lines of URLs.
The first is active and what I want from the other links. I know if I manually put my cursor at the end and hit enter, I can make it active.

How do I automate this with a stamp.

Text w URL Links.tbx (138.8 KB)

Thanks in advance
Tom

I don’t believe you can do this. Why? Because there is no action code trigger to force a re-scan of note $Text to detect URLs and create the Tinderbox web links as you desire. (P.S. I did look at the TBX, for which, thanks).

Thanks Mark. Is there any way to do this with a stream parsing operator… beginsWith… endsWith and adding a space?

Tom

Not at present. But any manual edit will do this.

Great point Paul!

you are right Paul It works simply by pasting in discourse…but why?
yes, In Tinderbox, manually moving your cursor to the end of the https address and adding a space…works

Interesting Devon: md works but you cannot paste it back, Devon rtf does not work, BBEdit md, html does not work, TextEdit does not work

I am scratching my head why some links work and others do not.
This is a personal gap in my knowledge
.
Do/Does you/anyone know why? Just a looping nagging thought I have stumbled into.

Thanks again
Tom

I believe Discourse is substituting markdown for the raw URL.

1 Like

Pasting into Discourse, or doubleclicking a Numbers cell with Edit > Substitutions > Smart Links turned on, pasting, and then copy-pasting back into Tinderbox will activate the links. But other styling (e.g. bold) is lost.

I believe the mystery of the dying links, with failure to export or preview as desired, may be related to having multiple links in the text of one note. Perhaps @eastgate and @mwra could have a look at that.

Attached is a tbx where I simply dragged in the url of this page from the browser multiple times, typing a return in between. Some of links are live as one would hope. Others mysteriously died along the way.

multiple-links-one-note.tbx (147.3 KB)

That strikes me as unlikely. But send along a test case!

I think a mis-presumption floating at the edge of the conversation is that Tinderbox constantly re-scans notes to find/adopt web links (assuming $SmartLinks is true) . A linked assumption is that we always want:

  • any URL in a note to be a ‘live’ link
  • all possible URLs in a note to be links

Those may be true for some but not all users/circumstances. In general terms, I think Tinderbox gets the balance right in terms of (not over-)detecting and link-ifying URLs.

The confusion here is all the kludges we’re discussing to make Tinderbox do something it doesn’t do when working manually! Here is the sample text from the test TBX:

In the grab, the first URL has been manually adopted by the OP putting the text cursor at the end of the URL and pressing Return (and thus the extra bank line). Importantly, and pertinent to the above discussion, that ‘edit’ action affects only the current URL (possibly the current line/paragraph).

The kludges suggested above are fine for occasional use but not realistic for an automated process elsewhere the whole point is to drive out unwanted manual, per-use, steps. IOW, what OK for fixing 1 use, isn’t so for something done 100s of times.

The starting scenario and further in-app edit testing shows there is a valid use case for being able to invoke—manually or via action code—a scan of $Text to find & adopt ‘bare’ URLs as Tinderbox web links. The code for this process already exists in the app. The missing part of the puzzle is on-demand invocation of the process for the whole of a current note’s $Text (as opposed to per URL or per $Text paragraph).

Separately, the seeming confusion about other apps providing the ‘correct’ text ought not to be so. We can observer a (un))expected result but the only really know why if we know what the originating app put on the clipboard: presumption != certainty, thus the unexpected results in some cases.


†. I’m not 100% sure what the detection rubric is but it appears to be the presence of :// between two spaces of paragraph start/end. Thus false detections are possible, typing we:/think in $Text makes a web link. A deliberate edge test and no harm as the occasional ‘mis-link’ can be right-clicked and deleted from the context menu (or via Browse Links. Note, that full auto-detection of links is an (unseen) 2-step process. In the moment the URL is detected and a web-link made. But, the link is not fully adopted/reported in Browse Links un til the note is de-/re-selected. That said, I doubt any but a few may trip on the latter: I note it for those who do.

‡. Testing in v9.6.1, editing a line with two un-linked URLs by the above Return key method the results are inconsistent. Sometimes all un-linked URLs in the line are adopted, other times only the one preceding the edit point.

6 posts were split to a new topic: Explode and weblinks in source $Text