[JW Lua] Calculating the last measure on a page

Jan Angermüller jan at angermueller.com
Fri Sep 5 01:27:25 CEST 2014


Jari,

the following script returns -1 as last measure
on a page where actually the several measures
(and the last measure of the piece) are placed,
but more empty pages follow.
Seems like calculating the last measure of the piece
doesn't work correctly, if empty pages follow.

local pages=finale.FCPages()
pages:LoadAll()
for page in each(pages) do
     local firstmeasure=page:CalcFirstMeasure()
     local lastmeasure=page:CalcLastMeasure()
     print("Measures",firstmeasure,lastmeasure)
end

This is the output on the part that has two pages
with music content (until measure 110),
followed by three empty pages:
Measures 1 76
Measures 77 -1
Measures -1 -1
Measures -1 -1
Measures -1 -1

Is it a bug ? Or does it have to do with Finale's sometimes
very weird behaviour with and existence of empty pages ?

Jan





More information about the JWLua mailing list