[JW Lua] Insert Staff Or Reorder Staves
Robert Patterson
robert at robertgpatterson.com
Sun Dec 13 14:17:43 CET 2020
Your script will just create a corrupted file (as you have discovered). The
only way to reorder staves is with Instrument Used lists. (I forget the
exact name in the PDK Framework, but it's there.) IUList 0 is Scroll View,
and each system in Page View has an IUList with a number equal to the
System Number. Each Staff Set (in Scroll View) is also an IUList. I believe
there are constants for the 8 staff list IUList numbers.
Each Linked Part has its own IULists. The only way to access them is to
switch to that part and then modify them from within the part.
On Sun, Dec 13, 2020 at 7:02 AM Martin Marris <mmarris at notecraft.com> wrote:
> I found a way to re-order the staves by re-ordering the Item Numbers. But
> it scrambles the score. Only some of the staff data get moved. The staff
> names and the transposition settings move from one staff to the other, but
> other data, such as clefs, and all of the notes, remain on the original
> staff.
>
>
>
> Here is the most basic version of my code. I also tried loading the staves
> into a table and iterating backwards, but got the same result.
>
>
>
> staff = finale.FCStaff()
>
>
>
> staff:Load(1)
>
> staff:SetItemNo(100)
>
> staff:Save(100)
>
>
>
> staff:Load(2)
>
> staff:SetItemNo(1)
>
> staff:Save(1)
>
>
>
> staff:Load(100)
>
> staff:SetItemNo(2)
>
> staff:Save(2)
>
>
>
> Martin
>
>
> _______________________________________________
> JWLua mailing list
> JWLua at jwmusic.nu
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20201213/744659d9/attachment.htm>
More information about the JWLua
mailing list