In order to solve this question, I'd like to obtain the absolute y position of a tikzmark (actually I want the distance from the border of the text area, but I guess it's not too hard to convert between these two values. The goal is to combine it with this solution). But I can't find how to do, any idea?
\documentclass[a4paper,12pt]{book}
\usepackage{tikzpagenodes}
\usetikzlibrary{calc,tikzmark}
\usepackage{lipsum}
\usepackage{showframe}
\usepackage{everypage}
\usepackage{changepage}
\begin{document}
\noindent Here is some text.
\begin{adjustwidth}{1cm}{-8em}
\noindent \tikzmark{hello}Hello. \message{Horizontal distance from border is ???}
\end{adjustwidth}
\end{document}

\pgfgetlastxy,\pgfextractxand\pgfextracty. You will probably also need\pgfpointanchorand\pgfpointdiff. – John Kormylo Nov 17 '21 at 15:00\pgf*commands? – tobiasBora Nov 17 '21 at 15:01\tikz@scan@one@point\pgf@process(pic cs:...)otherwise. But it's not really elegant this this is not documented. – tobiasBora Nov 17 '21 at 15:11