Hi all, I have quite some time without scripting and now I’m trying to make a simple script and I can’t find the error and I think is very simple.
No matter in which page I start it, the script fails at 2nd page and I can not find why. So if you help me! TIA
tell application "Adobe InDesign CS5"
set EsteDoc to document 1
tell EsteDoc
tell view preferences
set ruler origin to page origin
end tell
set Folios to "262"
repeat with i from 2 to 33
set Pagina to name of page i
if (Pagina mod 2) = 0 then
set GB to {20, 20, 20, 20}
my CrearFolio(Pagina, GB, Folios)
set Folios to Folios - 1
else --página par
set GB to {10, 10, 10, 10}
my CrearFolio(Pagina, GB, Folios)
set Folios to Folios - 1
end if
end repeat
end tell
end tell
on CrearFolio(Pagina, GB, Folios)
tell application "Adobe InDesign CS5"
set EsteDoc to document 1
tell EsteDoc
set TFolio to make text frame at page Pagina with properties {geometric bounds:GB, contents:Folios, item layer:layer 1, name:"#folios"}
--tell TFolio to set applied paragraph style of paragraphs of it to "folios"
end tell
end tell
end CrearFolio