Can you define "can't get it to work"? There are too many possible reasons (for example, maybe you don't know how to save a script). The same goes for "Must be an error" -- if you get an error message, please tell what the error is, and the line it reports.
thanks for your fast response.
In my ExtendScript Toolkit I get the message "undefined is not an object" on line 3 when running with ExtendScript Toolkit CC
Maybe I don't know how to save a script, if there is more to it, than saving it in the right location?
Maybe I made a mistake upon cleaning up your provided script.
For me, it looks like you did not choose a target application (left-up dropdown list in ESTK) so your code do not recognize activeDocument.pages object
As Jongware said - reasons are hiding everywhere...
Good catch, Jarek! I never run scripts from within the ESTK so I would never have come up with that.
At a glance, the script itself does not use any special features from before CC, and even though it is from 2008 (which was a surprise, I can't recall writing it!) it should work. I cannot test because I don't have CC.
We're all getting older, Theunis.
Sorry, still getting the undefined result in ESTK.
The script does nothing in InDesign.
I even tried it within InDesign CS5 and even with the original 32-page script.
How do I recognize incorrect less than's? I can't think of any other error :-(