Reading a .pdf file for info

Hello,

I was looking to get a macro that allows me to get the name and last edit dates of files that are in a directory on my machine (I’m on Linux) to a spreadsheet.

I found and I copied a macro I found in here that allows me to get the file names, but I have no idea how to get the dates, and I’ve found nothing on the internet yet, so I wonder if it’s possible to extract such info.

I’d like to either get the last edition dates of the files OR read the files (.pdf) to find the date (the date is always written within the pdf after a recurring string like : “date of intervention : DATE”) and write it next to the file names.

Is this possible ?
Thanks

LibreOffice Basic offers a set of Function / Sub for getting files and information about them, and some to manipulate the properties.
See Run-Time Functions - LibreOffice Help
The information is not extracted from the file content, but taken from the file system of the OS.

Ok Thanks, I found this : FileDateTime Function [Runtime] - LibreOffice Help
But how do I use this in a way to write the date of each file in a cell next to the file name ?

Have a look at the vade mecum for Basic programming, Andrew Pitonyak’s Open Office Macros Explained, http://www.pitonyak.org/OOME_3_0.pdf. I think his Sub printDocProperties on p 297 tells you what you need.