<div dir="ltr"><div>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.</div><div><br></div><div>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.</div><div><br></div><div>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 <a href="https://github.com/Nick-Mazuk/jw-lua-scripts#resources">here</a>.</div><div><br></div><div><br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Oct 4, 2020 at 8:35 AM Emile Meuffels <<a href="mailto:e.meuffels@gmail.com">e.meuffels@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">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...<div><br></div><div>My code is based on the example script on the Lua-site (where "style" is a local decided by the program before):</div><div><br></div><div><div>    local musicRegion = finale.FCMusicRegion()</div><div>    musicRegion:SetCurrentSelection()</div><div>    local startbar = musicRegion:GetStartMeasure()</div><div>    local endbar = musicRegion:GetEndMeasure()</div><div>    local ssa = finale.FCStaffStyleAssign()</div><div>    ssa.StyleID = style</div><div>    ssa.StartMeasure = startbar</div><div>    ssa.StartMeasurePos = 0</div><div>    ssa.EndMeasure = endbar</div><div>    ssa:SetEndMeasurePosRight()</div><div>    ssa:SaveNew(1)</div></div><div><br></div><div>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.</div><div>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...</div><div><br></div><div>Any idea how I can make this work?</div><div><br></div><div>All the best,</div><div><br></div><div>Emile</div></div></div>
_______________________________________________<br>
JWLua mailing list<br>
<a href="mailto:JWLua@jwmusic.nu" target="_blank">JWLua@jwmusic.nu</a><br>
<a href="http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu" rel="noreferrer" target="_blank">http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu</a><br>
</blockquote></div>