title: Google Apps Script Make text a clickable URL using replaceText()
body: <p>I have this code that opens the file and replaces a string using replaceText.</p>
  
  <pre><code>var url = 'http://www.test.com';
  var doc = DocumentApp.openById(file.getId());
  doc.replaceText("&lt;&lt;urlGoesHere&gt;&gt;", url);
  doc.saveAndClose();
  </code></pre>
  
  <p>When I open the doc, the replacement has occured, but the url is not a clickable hyperlink, it's just static text. Is there a way to programmatically make it a clickable link?</p>
  
  <p>I found this method of text called setLinkUrl, but there's no documentation/examples: <a href="https://developers.google.com/apps-script/reference/document/text#setLinkUrl(String)" rel="nofollow noreferrer">https://developers.google.com/apps-script/reference/document/text#setLinkUrl(String)</a></p>
  
  <p>Any ideas?</p>