<p dir="ltr"></p>
<p dir="ltr">Thank you very much! <br>
It works fine now. <br>
I am still struggling with the intermingling of measures and systems sometimes. <br>
I hope to learn more of the following example scripts. <br>
I very much like the group script idea. </p>
<p dir="ltr">All the best! <br>
Herbert </p>
<div class="gmail_quote">Op 6 nov. 2013 17:16 schreef "Jari Williamsson" <<a href="mailto:jari.williamsson@mailbox.swipnet.se">jari.williamsson@mailbox.swipnet.se</a>>:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Herbert et all,<br>
<br>
To load a measure number, the construction of the measure object should have no parameters, and the Load() method (which you commented out) should have a parameter with a measure number. (I now noticed that JW Lua will crash if there's no parameter, I'll see if I can fix that.)<br>
<br>
So, first replace the 2 first lines that loads the next measure with:<br>
local m = finale.FCMeasure()<br>
m:Load(measure.ItemNo +1)<br>
<br>
Second, you also need to remove the line with SaveAll() at the end, since it will overwrite the change you made earlier in the script with the original data.<br>
<br>
<br>
Best regards,<br>
<br>
Jari Williamsson<br>
<br>
On 2013-11-05 21:45, Herbert van Essen wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello Jari,<br>
<br>
I know you're very busy but this thing is driving me crazy while it must<br>
be very simple.<br>
I try to get a pagebreak after a final barline:<br>
<br>
local region = finale.FCMusicRegion()<br>
region:SetCurrentSelection()<br>
selectedmeasures = finale.FCMeasures()<br>
selectedmeasures:LoadRegion(<u></u>region)<br>
<br>
<br>
for measure in each(selectedmeasures) do<br>
if measure.Barline == finale.BARLINE_FINAL<br>
then<br>
print ("Double barline found in measure ", measure.ItemNo)<br>
local m = finale.FCMeasure(measure.<u></u>ItemNo +1)<br>
--m:Load()<br>
m.PageBreak = true<br>
m:Save()<br>
end<br>
end<br>
selectedmeasures:SaveAll()<br>
<br>
What am I doing wrong here?<br>
<br>
Kind regards,<br>
Herbert<br>
<br>
<br>
2013/11/5 Herbert van Essen <<a href="mailto:hpvanessen@gmail.com" target="_blank">hpvanessen@gmail.com</a><br>
<mailto:<a href="mailto:hpvanessen@gmail.com" target="_blank">hpvanessen@gmail.com</a>>><br>
<br>
Hello Jari,<br>
<br>
I tried also the "nextsystem.BottomMargin ="<br>
It differs from the actual setting a factor 96!<br>
And the "nextsystem.RightMargin =" is working very strange.<br>
Is this not working or am I missing something?<br>
<br>
Kind regards,<br>
<br>
Herbert<br>
2013/10/30 Jari Williamsson <<a href="mailto:jari.williamsson@mailbox.swipnet.se" target="_blank">jari.williamsson@mailbox.<u></u>swipnet.se</a><br>
<mailto:<a href="mailto:jari.williamsson@mailbox.swipnet.se" target="_blank">jari.williamsson@<u></u>mailbox.swipnet.se</a>>><br>
<br>
Herbert,<br>
<br>
I would do something like this. The "systems" collection loaded<br>
at the start is for reference only - it's used to find out if a<br>
measure belongs to a system. If measures are rearranged across<br>
systems during the measure loop, that reference collection needs<br>
to be reloaded.<br>
<br>
---<br>
finale.FCStaffSystems.__<u></u>UpdateFullLayout()<br>
systems = finale.FCStaffSystems()<br>
systems:LoadAll()<br>
<br>
<br>
allmeasures = finale.FCMeasures()<br>
allmeasures:LoadAll()<br>
for measure in each(allmeasures) do<br>
if measure.Barline == finale.BARLINE_DOUBLE then<br>
print ("Double barline found in measure ", measure.ItemNo)<br>
for ss in each(systems) do<br>
if ss:ContainsMeasure(measure.__<u></u>ItemNo) then<br>
local nextsystem = finale.FCStaffSystem()<br>
nextsystem:Load(ss.ItemNo + 1)<br>
nextsystem.TopMargin = (80)<br>
nextsystem.LeftMargin = (40)<br>
nextsystem:Save()<br>
end<br>
end<br>
end<br>
end<br>
---<br>
<br>
Best regards,<br>
<br>
Jari Williamsson<br>
<br>
<br>
On 2013-10-30 14:56, Herbert van Essen wrote:<br>
<br>
<br>
Hi Jari et al,<br>
<br>
I try to change the left and top margins of a system after<br>
the measure<br>
that has a double barline.<br>
How should I load the right system after the measure with<br>
the double<br>
barline?<br>
<br>
<br>
allmeasures = finale.FCMeasures()<br>
allmeasures:LoadAll()<br>
for measure in each(allmeasures) do<br>
if measure.Barline == finale.BARLINE_DOUBLE then<br>
print ("Double barline found in measure ",<br>
measure.ItemNo)<br>
local ss = finale.FCStaffSystem()<br>
ss:Load(measure + 1)<br>
ss.TopMargin = (80)<br>
ss.LeftMargin = (40)<br>
ss:Save()<br>
end<br>
<br>
finale.FCStaffSystems.__<u></u>UpdateFullLayout()<br>
end<br>
<br>
Thanks very much!<br>
<br>
Herbert<br>
<br>
<br>
______________________________<u></u>___________________<br>
JWLua mailing list<br>
<a href="mailto:JWLua@jwmusic.nu" target="_blank">JWLua@jwmusic.nu</a> <mailto:<a href="mailto:JWLua@jwmusic.nu" target="_blank">JWLua@jwmusic.nu</a>><br>
<a href="http://jwmusic.nu/mailman/__listinfo/jwlua_jwmusic.nu" target="_blank">http://jwmusic.nu/mailman/__<u></u>listinfo/jwlua_jwmusic.nu</a><br>
<<a href="http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu" target="_blank">http://jwmusic.nu/mailman/<u></u>listinfo/jwlua_jwmusic.nu</a>><br>
<br>
<br>
<br>
<br>
______________________________<u></u>___________________<br>
JWLua mailing list<br>
<a href="mailto:JWLua@jwmusic.nu" target="_blank">JWLua@jwmusic.nu</a> <mailto:<a href="mailto:JWLua@jwmusic.nu" target="_blank">JWLua@jwmusic.nu</a>><br>
<a href="http://jwmusic.nu/mailman/__listinfo/jwlua_jwmusic.nu" target="_blank">http://jwmusic.nu/mailman/__<u></u>listinfo/jwlua_jwmusic.nu</a><br>
<<a href="http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu" target="_blank">http://jwmusic.nu/mailman/<u></u>listinfo/jwlua_jwmusic.nu</a>><br>
<br>
<br>
<br>
<br>
<br>
______________________________<u></u>_________________<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" target="_blank">http://jwmusic.nu/mailman/<u></u>listinfo/jwlua_jwmusic.nu</a><br>
<br>
</blockquote>
<br>
<br>
<br>
______________________________<u></u>_________________<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" target="_blank">http://jwmusic.nu/mailman/<u></u>listinfo/jwlua_jwmusic.nu</a><br>
</blockquote></div>