Evaluate a HYPERLINK formula's target URL

Dear Reader,

Given the sheet in the sample images, is it possible to extract (in a Python macro) the complete target url of the HYPERKINK formulae in the cells?

Using the MRI-inspector tool, I see that cell.getText().Formula and cell.getText().FormulaLocal return the formula, e.g. =HYPERLINK(CONCAT("./";B4;"/fullpage/";C4;"-fullpage.html");“FULLPAGE HTML”), and that cell.getString() returns the replacement text (e.g. “FULLPAGE HTML”).

But it’s not readily clear to me how I can obtain the fully parsed target url, e.g. “./cees-stam/fullpage/ddd:010619689:mpeg21:p002-fullpage.html”, even though even the tooltip seems to get it.

(Please note that there is some variation in the construction of the target link in the various columns.)

I realize that I can (re)construct the respective target url’s in the Python macro, but I was just curious if they can’t be obtained through the uno interface.

Thank you.


https://forum.openoffice.org/en/forum/viewtopic.php?f=21&t=2762
See the
= CELL_URL()
StarBasic function

Unfortunately that only works for links that have been created via the Insert > Hyperlink (Ctrl-K) menu item.
My hyperlinks are created by Formula’s in the cells.

Please upload a real, ODF type sample file here (instead of images)

Here is the spreadsheet:

py-test.ods (21.6 KB)

Try to create the URL based on the input data.
You can not use the dot “./” to represent the “ThisFolder” inside the LibreOffice. (The Op.Sys maybe can recognise the dot as “ThisFolder” in the passed URL)
You must get the URL and Path of the actual document by macro:

GetURL.ods (15.7 KB)

With
⇒Tools⇒Options⇒Load/Save⇒General⇒⇒Save: [x]Save URLs relative to filesystem

./ means: »the_folder_where_this_file_is_stored«

../  means:  »the_parent_folder_of_the_folder_where_this_file_is_stored«

for me HYPERLINK-formulas with prefixes like above works flawless