Very helpful in seeing if our listing is in the SERPs of different google searches, thank you.
How would I get the line number of the text I'm looking for in the variable.
ie. I'm looking for house-cleaning within the URL's that are returned, if that text is in one of the URL's I'd like to know what number line its on.
This way I can programmatically track the results monthly.
Thank you in advance.
Apologies, I just realized I replied to your 'Macro Library' post.
Can you move this to a new post titled
Get line numbers of variable or something like that?
I've revised my macro from the other topic to provide an example of what you are now asking for.
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.
Author.@JMichaelTX based on script by @ccstone
- 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
- Review the Actions in magena color, and change as desired
- IF Local__Return_Data is set to "MD", then it returns Markdown links
- Default: URL
- Markdown Format:
- The max number of links returned is set by the Variable Local__Max_Links
- ADD the Actions you want to process the results (list of URLs)
• Any Action in magenta color is designed to be changed by end-user
- 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
(1) Keyboard Maestro Ver 7.2.1+
(2) Yosemite (10.10.5)+
(3) Safari or Google Chrome
Thank you @JMichaelTX for your time.
I do get an error when running the macro. Although I have worked a bit revising your initial macro to create what is a good solution for me.
I periodically check our SERPs.
We have 2 different websites that I check for.
This macro will check the current results and show if either of those 2 sites are listed and their # position.
I know my macro could be done cleaner, and it's probably a bit rough around the edges but for now, it does exactly what I need it to do.
Could have never ever gotten to this point without your expert help and initial macro, so as always, many thank you's to you @JMichaelTX
[WEB] Get URLs from Google Search Results TK.kmmacros (36 KB)
Can you please post a screenshot of the error.
You're welcome. Glad you got it working.
I looked as best I could at your macro, not sure if I need to do anything to make it work.
at this point I don't need it, but making it work would as always, help me learn.
Did you first do a Google Search, and with that as the frontmost window, trigger the macro?
ok, I'm obviously missing the entire boat here, I apologize.
I downloaded a fresh macro from above.
I did a google search in safari.
I ran the script - it error'd out.
As I said, I don't need this particular macro any longer, it was the complete basis for the macro I altered and now works for me.
But I don't need to make this work.
I appreciate your help.
Search google for
Yonkers House Cleaning
Run the macro - it does not display the results in a window - it returns nothing.
2019-08-26 12:47:16 Prompt With List failed with no result Macro “Get Selected URL and Line Number from List [Example]” cancelled (while executing Prompt With List “” from Variable “Local__URL_List”).