The real URL always begins with either http or https and is the second instance in the string of http(s) and it always ends with the first &
So, I’m wondering if a Keyboard Maestro macro could be created that strips out everything before the second instance of http and everything after the first & and then opens the proper URL in Safari?
Could the macro be added to services? That way I could right click on a Google Alerts URL in Feedly that looks of interest, select Services and then the macro from the list.
I’d appreciate any thoughts on how this could be done.
That’s a great little utility Ben, I’ve tested it with several Google Alerts links and it works consistently. Now I need to figure how to incorporate it all into Keyboard Maestro. If nothing else you’ve shown me great way to capture the content I need.
Indeed, Chris. But as I understand it, the '&' belongs to the Google-URL and not the real URL duncmac needs.
Duncmac, this macro should do the trick. You just copy your Google-URL to the clipboard and press Cmd-< (that is the character next to the left Shift-Key on my keyboard).
For adding the macro as a service, you probably have to use Automator, which then fires a trigger. Not sure how to do that.
Thanks for the follow up Ben, I’ll get this set up tomorrow and let you know how it goes.
And thats a good point about the ‘&’ Chris, I’ve not seen an instance of it yet in these Google Alerts results, however I expect I may get the odd one.
There are a lot of things you can add. For example, a routine that checks whether there is a valid URL in the clipboard in the first place, if any. Just play around with some of the other actions KM provides. The regular expression was probably the “hardest” part of your issue to be solved.