I've slightly modified it in a few ways to suit my purposes, but also make it more adaptable for others:

1. It'll now automatically translate to the user's system language. In other words, if you don't supply any parameters to the GoogleTranslate function other than the string, it'll translate it to your Windows language, rather than to English. This makes it easier to use for non-English speakers and for people writing scripts that they want to be automatically translated for all end users.

2. If you supply the original language as the 2nd parameter and that happens to be the same as the user's system language, no attempt at translation will be performed. That improves performance by not sending unneeded translation requests to Google. So, for example, if your messages are in English, you can improve performance for yourself and other English speakers by doing GoogleTranslate("Sample text", "en").

3. If a response isn't received back from Google, it'll return the original, untranslated string. This way, your scripts won't break if there's no internet or Google's servers detect spam. Strings will just be in the script's original language until the connection is restored.

since first one needs a temp file. However, last one is more "heavy" since com-object "htmlfile" is created there. You could use what you prefer. Also lexikos'th ActiveScript could be used here instead.

It's a very nice script and idea, but I'm worried that it will get blocked.

Yes, I've already had this happen. That's why, in my version above, I added a simple condition to detect when the script was getting blocked and, in those cases, return the untranslated string (because, otherwise, a blank string was being returned). The block is only a temporary one on your IP, but it's a good reason to not over-use the function in your scripts so that you don't trigger it. By my estimation, it took sending hundreds or even thousands of translation requests in the span of just a few minutes for me to trigger the block, so more reasonable usage in scripts may be perfectly safe.