Ok. I misunderstood. Now it's clear to me. Let's see:
1. "undefined" is the default for an appliedParagraphStyle in findTextPreferences, if the search is not restricted to a paragraph style
2. If the search is restricted to a specific paragraph style we get a string in return, istead of a paragraph style object.
What to do?
We could temporarily rename all paragraph styles adding their unique ID number and ask again.
Uwe