Highlighting Text in Web Pagess

Gary of MacMost dot Com put out a little video to his patreon group showing how you can create a shortcut in MacOS to create a link to some highlighted text in a web page. For some reason, it doesn’t work on all web pages, but it does work on ATBREF.

So if you wanted to call attention to a particular sentence in a note with a lot of text, the link would look like this. (Look at the link in the browser after you click on it. Tried to include it here, but it gets processed. I’m sure there’s a way to escape that, but I’m not that savvy.)

Create the shortcut as a Service. Select the text you want to highlight on the web page, and run the Service. It places the URL on the clipboard.

Seems kind of handy.

3 Likes

Neat! Thanks. The link in the post is to https://acrobatfaq.com/atbref95/index/Objects_in_Tindebox_documents/Notes_Containers/Special_types_of_notes/Adornments_for_Maps_and_Timelines.html#:~:text=Note%20that%20adornments%20do%20get%20counted%20in%20the%20outline%20order%20numbering,%20even%20if%20not%20visible%20there;%20the%20are%20counted%20as%20the%20last%20sibling%20children%20of%20the%20note%20on%20whose%20Map%20view%20they%20appear

(I used back-ticks before after the URL to foo the parser that the IRL was code)

So the pattern generated by Shortcuts.app seems to be (for those wishing to do this by hand or via other means):

  • target URL
  • plus literal string #:~:
  • plus url-encoded text of the selected text.

Thanks for sharing. :slight_smile:

1 Like

That’s correct. There’s a built-in facility to create those links in Chrome, but not in Safari. Safari does exhibit the desired browser behavior on most sites. Some I think use Javascript to block highlighting like this. :cry:

1 Like