Tanaike's answer should work for you. I was curious to see how to do it in basic Apps Script without advance services, and the below is working for me.
It only works for the current active cell, so click the cell where you want the hyperlink from to make it active.
function getHyperlink() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getActiveSheet();
var range = sheet.getActiveCell();
var formula = range.getFormula();
Logger.log(formula.slice(formula.indexOf("\(")+1,formula.indexOf("\,")) );
}
Hyperlink formula: =HYPERLINK(" [url] ", " [display text] ")
Because the Hyperlink Formula has two unique characters we can look for [ open parentheses '(' and comma ',' ] , just grab the part in between.
Hope that is helpful.