O routinely deal with web pages translated by Google Translate. It has the habit of hijacking the page's links and appending Google Translate functions to them. I'm trying to create a script that will "clean" the selected URLs back to the originals and replace them.
For example, here are a couple of URLs I took from these pages:
Code: Select all
https://translate.google.com/website?sl=en&tl=pt&hl=pt-BR&client=webapp&u=https://www.google.com/url?q%3Dhttps://www.wired.com/gallery/best-office-chairs/%2523intcid%253D_wired-right-rail_99d755e0-3dd4-453d-8744-3ddec6243313_popular4-1-reranked-by-vidi%26sa%3DD%26source%3Deditors%26ust%3D1651087654369297%26usg%3DAOvVaw3CD9UQFJ7rq6uxGd800vVi
https://translate.google.com/website?sl=pt&tl=en&hl=pt-BR&client=webapp&u=https://www.google.com/url?q%3Dhttps://news.un.org/pt/story/2019/05/1671401%26sa%3DD%26source%3Deditors%26ust%3D1651086721941906%26usg%3DAOvVaw0uXAohDouhPpuo56vvX8SC
https://translate.google.com/website?sl=en&tl=pt&hl=pt-BR&client=webapp&u=https://www.google.com/url?q%3Dhttps://www.wired.com/story/elon-musk-buys-twitter-deal/%2523intcid%253D_wired-right-rail_99d755e0-3dd4-453d-8744-3ddec6243313_popular4-1-reranked-by-vidi%26sa%3DD%26source%3Deditors%26ust%3D1651087654366793%26usg%3DAOvVaw393tXu7_i5rylakkn8q0zk
Code: Select all
(?<=q%3D)(.*)(?=%26sa)
Code: Select all
#T::
SaveVar=%ClipboardAll%
Clipboard=
Send ^c
ClipWait, 0.5
Clipboard := RegExMatch(Clipboard, "(?<=q%3D)(.*)(?=%26sa)")
Send ^v
Sleep 100
Clipboard=%SaveVar%
SaveVar=
return
Can someone help me clear this up?
Thanks in advance!