[JW Lua] Document Blank in Scroll View (Solved)

Martin Marris mmarris at notecraft.com
Sat Jan 2 10:16:37 CET 2021


Problem solved. You will recall that after being processed by my JW Lua
script, my files were blank in Scroll View (and sometimes, merely switching
to Scroll View would crash Finale).

 

I isolated the section of JW Lua code that was triggering the issue. About
halfway through the script, there is code that deletes all of the original
staves from the source document: they have already been copied onto newly
appended staves and must now be discarded. But running that section of code,
on its own and without anything else, caused Scroll View to be blank (Page
View was fine).

 

The files I am working are very old (from about 20 years ago). I discovered
that if I created a brand-new Finale file and ran my code on this new file,
there was no problem with Scroll View.

 

Finally I found that if I open one of these ancient Finale files, and then
run Document => Data Check => File Maintenance prior to running my JW Lua
script, Scroll View is restored to normal operation.

 

When I run File Maintenance, it doesn't find much wrong with the files
*except* that it always "removes" one staff that was "deleted" at some time
in the past.

 

Another thing that is now fixed by File Maintenance is that the files, after
being processed in JW Lua and exported to another app via XML, no longer
have a blank "unknown MusicXML instrument" at the bottom of the score. This
was not just a bore, but was sometimes causing instability in the
destination app.

 

So I've added File Maintenance to my routine, every time I open one of these
old files for the first time. I tried to find a way to achieve the same
thing programmatically in Lua but my various attempts to detect the "phantom
staff" failed, and without being able to detect it, I cannot delete it.

 

Martin

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20210102/3268db82/attachment.htm>


More information about the JWLua mailing list