1

So I have this small script that uses getPlainBody() to get the message body of a GmailApp thread, that part is fine and working. Somewhere inside that body is a URL, let's say "http://www.aohell.com/tacofriedrice"

Is it possible to have a script find and pull that entire link just by searching for part of it?

For example, I want the script to search the message body for "http://www.aohell.com" and if it finds that match, it will pull the rest of the URL "http://www.aohell.com/tacofriedrice" and save it to a variable.

I had found a method ".findText("http://.*/")" while looking around existing posts, but findText doesn't appear to actually be an existing google apps function according to the error message. Afterwards what I found suggests to use .getElement().asText().getText() but I've got no idea if those will work either since findText() doesn't.

3

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.