[JW Lua] Calculating the last measure on a page

Jan Angermüller jan at angermueller.com
Fri Sep 5 10:33:58 CEST 2014


Jari,

inserting the finale.FCStaffSystems.UpdateFullLayout()
or calling "Update Layout" manually didn't make a change.
Although I know of other cases where the UpdateFullLayout
function call helped me some months ago.

I had to delete the empty pages with page:DeleteData()
or manually.
It seems to me that it was a Finale issue with weird
empty pages. I also have no idea why Finale added
these three empty pages.

Jan

Am 05.09.2014 07:39, schrieb Jari Williamsson:
> 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
>>
>>
>
>
>
> _______________________________________________
> JWLua mailing list
> JWLua at jwmusic.nu
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
>





More information about the JWLua mailing list