Sort text by Layout

Thanks Rickson for the quick answer.
But…I have looked trought FatTools and I could not make what I am looking for, maybe I should have put more context.
I want to retreive the information from the texts in the layout to build a file naming to output all the layouts of the file as single pdf files. So for the three pages I would get a file named:
text A1-text A2-text A3.pdf for Page 1
text B1-text B2-text Bpdf for Page 2
text C1-text C2-text C3.pdf for Page 3

I haved test with this script for the pdf print and I think it will work, just need to retreive information from each layout…

And putting the date at the end.

Thanks (9.9 KB)