Run-script-before-required: list items in a backup

Before starting the backup, the only information known to Duplicati is essentially the user input.
In this case the DUPLICATI__LOCALPATH information is the paths chosen to be restored.
The actual paths to be restored are not known before the database is consulted or a remote filelist is retrieved.

The scripts were originally designed to set up various things, such as mount a folder, fetch credentials etc. For this reason the scripts run before any interactions and this limits the information that can be obtained.

If you want to get the list of files to be restored, you could try to launch the Duplicati.CommandLine.exe / duplicati-cli program and pass the database, restore paths and filter properties. I think it will be error prone to do generally, but if you have some specific limited inputs that you need and can live with the results not being 100% accurate, then maybe you can work around it this way.