I have a field that asks the user for a full address to be typed in. I'd like to add a button that, when clicked, launches the default browser and performs a Google Maps search of that address. Or, at the very least, a Google search of that address.
Is there a relatively easy script that can be applied to that button?
The short answer is NO. Acrobat form scripts have no mechanism for receiving and interpreting results from a web API.
But, there are a couple of other options. If you could install an Acrobat automation script on to the user's system, then that script could execute SOAP and regular HTTP request. If this is not possible, then the other option is to write a server script that does the api calls to google maps. This scirpt would get the form submit from the PDF, interact with google, and return results that the PDF form can use.
app.launchURL("https://www.google.com/maps/search/" + this.getField("Full Address").valueAsString);
Just to clarify: This will open the URL in the default browser. It will NOT make the results accessible to your code or allow you to embed them in your PDF or anything like that.
Brilliant. Thank you so much. Worked like a charm.