I've revised my macro from the other topic to provide an example of what you are now asking for.
Example Output
MACRO: Get Selected URL and Line Number from List [Example]
--- VER: 2.0 2019-08-23 ---
Requires: KM 9+ macOS 10.11 (El Capitan)+
(Macro was written & tested using KM 9.0+ on macOS 10.14.5 (Mojave))
DOWNLOAD Macro File:
Get Selected URL and Line Number from List [Example].kmmacros
Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.
ReleaseNotes
Author.@JMichaelTX based on script by @ccstone
PURPOSE:
- Get List of URLs (or MD Links) from Google Search Results
- Works for FrontMost Browser
HOW TO USE:
- Do a Google Search in either Safari, Chrome, or Chrome-based Browser
- Trigger this macro
WHAT IT DOES:
- Scans the Google results, and returns one link per result
- Each Line contains LineNumber«Link
- User is then prompted to select one line from results
- The Line# and Link are displayed
MACRO SETUP:
- Review the Actions in magena color, and change as desired
- Local__Max_Links
- Local__Return_Data
- IF Local__Return_Data is set to "MD", then it returns Markdown links
- Default: URL
- Markdown Format:
[Link Text](URL)
- The max number of links returned is set by the Variable Local__Max_Links
- Default: 10
- ADD the Actions you want to process the results (list of URLs)
TAGS: @XPath @Google @Chrome @Search @Links @JavaScript
USER SETTINGS:
• Any Action in magenta color is designed to be changed by end-user
REF:
- Macro/Script by @ccstone (Chris Stone), 2015-12-04
ACTION COLOR CODES
• To facilitate the reading, customizing, and maintenance of this macro,
key Actions are colored as follows:
• GREEN -- Key Comments designed to highlight main sections of macro
• MAGENTA -- Actions designed to be customized by user
• YELLOW -- Primary Actions (usually the main purpose of the macro)
• ORANGE -- Actions that permanently destroy Varibles or Clipboards
REQUIRES:
(1) Keyboard Maestro Ver 7.2.1+
(2) Yosemite (10.10.5)+
(3) Safari or Google Chrome