Try this, it works in CS6 for me.
tell application id "com.adobe.inDesign"
set pagina to document offset of active page of window 1
set texto_marco_1 to text frame 1 of the active page of active window
set s to swatch "Red" of active document
set p to object reference of line 1 of paragraph -1 of texto_marco_1
repeat with x in p
set fill color of x to s
Try this. It works if there is one and only one text frame on each page.
tell application "Adobe InDesign CC 2018"
set docRef to document 1
set redColor to swatch "C=15 M=100 Y=100 K=0" of docRef
set pageCount to count of pages of docRef
repeat with i from 1 to pageCount
set thisPage to page i of docRef
set bottomFrame to text frame 1
set textRef to (a reference to line -1 of bottomFrame)
set fill color of textRef to redColor
Yes, it is working on that condition: one frame por page.
Thanks for your time.
Could not find the «green» button to apply solved.