Hello all. I am in the UK. Most links to Amazon I find are to the US store (.com). I would like to have KM automagically open such a link in the .co.uk store. At the moment, I open in .com, Cmd-L, then select .com and type “cok” which auto-expands to “co.uk”. It would be nice to make it a bit more direct and quicker.
I’m not a coder and it’s such a small thing that it’s not really worth it to me to get good enough at coding to sort it. If anyone can do it in 5 mins, it would be fab.
Thanks, my friends.
Ask and ye shall receive
Auto-Change Amazon URLs.kmmacros (3.4 KB)
You didn't specify which browser you use, so I put this macro in a group that's only active in Safari and Chrome and used the new-to-KM8
%FrontBrowserURL% token to ensure the macro could be used in either browser (unfortunately, similar actions and tokens cannot be made for Firefox, so this only works in Safari and Chrome). There may still well be a better way to do this, but this macro should get you started. Please note that in my limited testing, most of the product pages I tried this on worked, but there were a few that didn't have Amazon.co.uk counterparts, so if you run into a 404 page while using this macro, that's most likely why.
Thanks, Gabe. Great for what I need. Would it be non-trivial to make this work in, say, Mail and Reeder?
You’re welcome, @jolyon. I’m glad you find it helpful. As for Mail and Reeder, as far as I know it should already work with Mail, since any Amazon.com links you click there should then open in your default browser, presumably Safari or Chrome, at which point the macro should “just work”. For Reeder, I’m afraid there’s nothing that can be done since there’s no way to manually set the URL of its in-app browser; the only thing you can do there is open links in Safari or Chrome rather than Reeder itself. In case you didn’t already know, in Reeder, the “B” button is a shortcut for opening the current feed item or page in your default browser, so that should at least make doing so a little easier.
Wow. Again, great advice. And sorry for not knowing that about Reeder. Works a treat.
Thanks so much and a very Merry Christmas to you.