Color Highlighting Linked Text

I just used TB for a qualitative study and am moving onto the next one and I realize I’d really like to be able to visually highlight passages of linked text and wondering if there’s any way to do this. I’d need to have several colors available for highlighting, and it’s okay w/me if the highlights are only visible in Preview. Something like this would be ideal:

I also would consider highlighting in a different program, e.g. DevonThink, and porting over for organizing in TB, but I’d like the color (and ideally other data) to port as well (would consider specific OnAdds for this, I think).

Anyone have ideas for how to make this happen?

1 Like

If I understand correctly, rather than (or as well as) an underline under anchor text, you want the anchor text highlighted. I’m not sure how easy that is as the links work in the plain-text rendition of the text and highlight needs the RTF layer (which, TBF, is the $Text render you see). So, today, I think ‘no’.

Path of the missing pieces is something like String.italic but as String.highlight(HltColour).

If you are talking about a link target note text anchor, an additional edge case that can’t be avoided by the old “but I’d never to that” deflection, is where more than one link points at the same or overlapping link spans.

You might achieve the effect you want, if I follow you, by separately highlighting and linking the passage in question. That’s a little more bother, but doesn’t seem that bad.

But perhaps something else is needed here.

To highlight in Preview, you could set the class of the link and then add a stylesheet.

Then, in your CSS, you might say:

a.yellow { background-color="yellow" }
a.red { background-color="red"; }
a.blue { background-color="blue";}

a.yellow { background-color:yellow; }
a.red { background-color:red; }
a.blue { background-color:blue; }

1 Like

This may well do the trick!

I know this is an annoying question these days, but is there any way to get the “create link” dialog box without the mouse?

Yes. Highlight the text you want to link and then click ^ ⌥ ⌘L (control+option+command+L).

If that doesn’t work and you use 1 Password, it is because that app also registers the same shortcut and on a wider scope; plus, the first to load of two, or more, apps trying to register the same shortcut owns the shortcut. So, as 1Password loads first here, unless I tinker, it registers that shortcut before Tinderbox gets a chance to do the same.

But knowing that there are all sorts of customisations possible, user shortcuts, KeyboardMaestro and similar.

2 Likes

Nice interception! I was just coming here to report that it doesn’t work, but I do indeed use 1Password. Anyone know if the ^ ⌥ ⌘L (control+option+command+L) option has a menu item?

1 Like

It is Note menu → Make Web Link. Note the ‘web’ part is optional, but if a URL is on the system clipboard, Tinderbox will load that into the URL section by default (you can delete it). URL or not, it opens the Create Link pop-over.

Hey @beck, @eastgate’s idea is really cool. The syntax, however, here is wrong in that is is written as HTML markup and not CSS syntax. If you put this in CSS you’ll want to right it like this:

a.yellow { background-color:yellow; }
a.red { background-color:red; }
a.blue { background-color:blue;}
1 Like

Aha! The reason it wasn’t working for me (and that I didn’t see it listed) is because I’d already changed that menu item to ⌘K to mirror other apps that use that for links. Thanks!

One more thing to note is that linked text using the parking lot method is not clickable in preview. Something to be aware of. So, you’ll get the highlighting of the link you want, but you won’t be able to click on it.

You can, of course, click on the link if you’ve exported the document.

Yes, that does works, i.e. when you export the links they work in the exported fine, and I’ve tested it. However, and to be clear not that anything is broken or particularly wrong, I think the first reaction is that people will want to, or expect that they can, navigate through their file in Preview, i.e. within TBX, before exporting, and in this case it does not work. That is the point, it is not the end of the world, I just wanted to make as that there is clarity on what to expect.

Question: Can I create a rule, edict, or agent that assigns link class?

I’m imagining a scenario where I go through and ziplink/tag certain phrases in a note’s text and then those phrases are styled based on the $Tags assigned. Doable?

1 Like

You can assign link type when you make the links, and (I think) class is inherited from the link type.

Having checked, unfortunately not. At present, I believe class can’t only be set manually within the app. On export ^linkTo()^ allows a class type to be set in code. But in the latter case this means setting every link by hand and there is no means to ‘read’ the list of available link types.

Thanks for checking, @mwra.

No worries. I both see what we’d a ‘like’ and the fact that it’s a likely non-trivial amount of change under the hood. Regardless, things in general are moving forward and, as shown in recent Saturday meet-ups, some interesting new features/improvements are on the way for when v9 comes out.

2 Likes