Yes, a wise angel, I had realised that I could write the functions as two function calls. I always write functions as stand-alone or pretty much stand-alone where possible, for a quick copy-and-paste without/with few dependencies.

Haha if people start making Christmas requests for functions I won't have time for anything else this year. I did anticipate that you might request this, or wish to request this, based on that other thread, I'll give it a go. Btw would such a function be very useful to you?

I'm quite glad to have written these functions now, because they were confusing me for a long time.

Not really at moment. However, you made most of the work already, so it slightly bothers me, that once I need it, there is work waiting . But please, no hurry or presure in the matter, not for me at least.

I'm quite glad to have written these functions now

They are very useful functions, I have made at least some of them when needed, I don't think I collected them though. I will refer back here when needed

Yes when you mentioned it before I envisaged a function that would get the caret position according to A_CoordModeCaret, but that could also return the raw numbers retrieved from GUITHREADINFO if specified by the optional mode parameter. Or indeed that you could manually specify Caret/Screen/Window, bypassing AHK's variable.