[JW Lua] Staff Styles

Robert Patterson robert at robertgpatterson.com
Sun Oct 4 15:48:17 CEST 2020


Just because the name starts with the text "22" doesn't mean the staff
style number is 22. Most likely the staff style has a different number in
the new file. The most reliable way to find the correct number is to search
the staff styles for the name you want.

Also, I believe that assigning a staff style in this manner only assigns it
in the current part or score. You should test this, at least. If you want
it assigned in all, you'll have to cycle through the parts for the part(s)
containing that staff.

Finally, you might find my Enigma Text Dump plugin handy for figuring these
things out. You can find a link in the Resources section of the ReadMe here
<https://github.com/Nick-Mazuk/jw-lua-scripts#resources>.





On Sun, Oct 4, 2020 at 8:35 AM Emile Meuffels <e.meuffels at gmail.com> wrote:

> I have been experimenting with adding staff styles through JW Lua to
> change the transposition of an instrument and I'm getting some results I
> don't understand...
>
> My code is based on the example script on the Lua-site (where "style" is a
> local decided by the program before):
>
>     local musicRegion = finale.FCMusicRegion()
>     musicRegion:SetCurrentSelection()
>     local startbar = musicRegion:GetStartMeasure()
>     local endbar = musicRegion:GetEndMeasure()
>     local ssa = finale.FCStaffStyleAssign()
>     ssa.StyleID = style
>     ssa.StartMeasure = startbar
>     ssa.StartMeasurePos = 0
>     ssa.EndMeasure = endbar
>     ssa:SetEndMeasurePosRight()
>     ssa:SaveNew(1)
>
> If I create a Staff Style and I name it "22. Transposition in G" and then
> set the local "style" to 22, this script works as expected.
> For the next step I created all the necessary staff styles and saved them
> as a library. If I load the library in a new file, I can see the "22.
> Transposition in G" staff style, but when I run the script, a staff style
> is added, but this one doesn't transpose. It also doesn't show a name...
>
> Any idea how I can make this work?
>
> All the best,
>
> Emile
> _______________________________________________
> 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/20201004/43c08ffb/attachment.html>


More information about the JWLua mailing list