How to Open a url in a new window, and then have the window re direct to to a different link.

How to Open a url in a new window, and then have the window re direct to to a different link.

Using zoho functions, and a button, I am working on having a link open and load information into a separate google sheet script, and then I want the window to redirect to a provided web site.  

get_potential_details = zoho.crm.getRecordById("Deals",potential_id.toLong());
url = " https://script.google.com/XXXXXXXXXXXXXXX";
url = url + "XXXXXXXXXXX/exec";
url = url + "?" + "Lead_Generator=" + get_potential_details.get("Lead_Generator").get("name");
url = url + "&" + "Zip=" + get_potential_details.get("Zip");
url = url + "&" + "Township=" + get_potential_details.get("Township");
openUrl(url,"new window");
// here I want this window to close after it loads the Url or, even better would be
//to have the new window redirect to a different page for example http://www.google.com

return "";