[JW Lua] Calculating the last measure on a page

Jari Williamsson jari.williamsson at mailbox.swipnet.se
Fri Sep 5 07:39:14 CEST 2014


Jan,

Insert a
"finale.FCStaffSystems.UpdateFullLayout()"
call before loading the info.

In general when dealing with page layout, when the user has AUL turned 
ON (which I believe 99% of the users have nowadays), the layout info 
related to systems and measures must be updated before reading. However, 
also make sure to not make unnecessary calls to 
finale.FCStaffSystems.UpdateFullLayout(), since it's very time expensive.


Best regards,

Jari Williamsson

On 2014-09-05 01:27, Jan Angermüller wrote:
> 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
>
>
> _______________________________________________
> JWLua mailing list
> JWLua at jwmusic.nu
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
>
>






More information about the JWLua mailing list