Thank you for replying. From your provided Spreadsheet, how about the following sample script?
function myFunction() {
const sheetName = "Лист1"; // Please set your sheet name.
const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(sheetName);
const range = sheet.getRange("A2:A" + sheet.getLastRow());
const urls = range.getRichTextValues().map(([a]) =>
[a.getRuns().reduce((ar, r) => {
const url = r.getLinkUrl();
if (url) {
ar.push(url);
}
return ar;
}, []).join(",") || null]
);
range.offset(0, 1).setValues(urls);
}
When this script is run, the URLs are retrieved from column "A". And, the retrieved URLs are put into column "B".