This can be done.
Can you explain exactly what you want the output of this script to be? Should it be a txt file? It sounds like you want some statistics of the contents of the indesign document.
Actually my recuirment is there will be so many number of frame or text frame will present there in a indd file
>with the help script im giving number to the script label . it follows the order of Stack
(the frame designed latest will get the latest script label)
>in a particular order the frame has to get numbered in script label
either from right to left or left to right.
hope u got my point
kindly help me out