Thank you very much for the reply, Masood!
The links you gave me are really useful for creating Indexes and I thank you, they will really come in handy one day.
The script that I’m looking for is a bit more simple (or is it?) than that: I don’t want the script to select just a list of words that have a certain style, I want it to take every group of consecutive characters that have that particular style, and specify their corresponding chapter/section number.
To give you an example, on a page that has two chapters there are two cases in different blocks of text: VanDyke v. SKI Ltd., 67 CA4th 1310 (1998) in section §1:01 and Curties v. Hill Top Developers, Inc., 14 CA4th 16 51 (1993) in section §1:02. These cases have a Character Style named CASE TABLE and the sections have a Character Style named RUNNING HEADER.
I am looking for a script that can look for these two styles and order them in a list (alphabetically or not) that would look something like this:
VanDyke v. SKI Ltd., 67 CA4th 1310 (1998), §1:01
Curties v. Hill Top Developers, Inc., 14 CA4th 16 51 (1993), §1:02
So the script idea (I have no idea about scripting so I’m just getting this on a logical pattern) would be something like:
[CASE TABLE], corresponding [RUNNING HEADER]