I finally got it but it is a cumbersome solution which I will temporarily use until adobe adds this support.
It goes like this:
Preparation:
- Prepare an extendedScript which generates a list of all layerComps and writes it to tmpFile.
tmpFile name is read from the layer[0] in the current doc. - Create a batchPlay function to run this script
Usage:
- Generate a new layer whose name equals to the plugin TemporaryFolder. this is now layer[0].
- Run the batchPlay action to run teh extendedScript.
- Read tmpFile (which was generated in TemporaryFolder by the extended script)
Complicated but working