I'm trying to figure out how to use getLinkUrl(offset)
in Google Apps Script.
I found the reference here - http://googlescriptreference.com/Document/Text/getlinkurloffset/, but I can't find any examples online.
This GAS returns Paragraph
in the logs
var paragraph = tableCell.getChild(0);
This GAS returns the text string in the paragraph
in the logs
var paragraphText = paragraph.getText();
This GAS returns NULL
in the logs
var paragraphText = paragraph.getLinkUrl();
This GAS returns an error ( Cannot find method getLinkUrl(number).) and nothing in the logs
var paragraphText = paragraph.getLinkUrl(2);
Can someone please help me understand how to use the getLinkUrl(offset)
?
Thanks for your help!
I was attempting to use the
getLinkUrl(offset)
directly on the paragraph element (not working example), but I needed to useasText()
method beforegetLinkUrl(offset)
.NOT Working
Working
Google Document https://docs.google.com/document/d/136G549zIYPYBndXs70ZnR_wEFg5fPST9ZGsOlTgmDyM/edit
@Tanaike helped me find this solution. https://stackoverflow.com/users/7108653/tanaike