<div dir="ltr"><div>I saw an additional issue, which is that the Undo does not undo the part width setting. I found some notes about this in my Patterson Plugins code, so the problem has been around a while.</div><div><br></div><div>Glad you found a workaround.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Apr 3, 2024 at 9:29 AM Jan Angermüller <<a href="mailto:jan@angermueller.com">jan@angermueller.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"><u></u>
<div>
Thank you for the quick response, Robert!<br>
I found a workaround which at least works in the test case below:<br>
When I (re-)save the measure width in the score afterwards, it is
still the same bug.<br>
BUT:<br>
When I slightly change the measure width in the score, save it, then
restore the original value and save it again, both the measure width
in the score and in the parts seem to have the correct value.<br>
It seems to set a flag in Finale that the measure width in the score
has indeed changed.<br>
<br>
I will have to check if this also solves the problem in Perfect
Layout.<br>
<br>
Here is the new test code with the additional lines in bold:<br>
<br>
--Show measure 1 width from score<br>
local meas=finale.FCMeasure(1)<br>
meas:Load(1)<br>
print("Measure Width in Score",meas.Width)<br>
<br>
--Load Part 3 and change<br>
local p=finale.FCPart(3)<br>
p:SwitchTo(); <br>
p:ViewInDocument()<br>
meas=finale.FCMeasure(1)<br>
meas:Load(1)<br>
print("Measure Width in Part ",p.ID,meas.Width)<br>
meas.Width=360<br>
meas:Save()<br>
print("Measure Width after change",meas.Width)<br>
p:SwitchBack(); <br>
<br>
--Go back to score and show measure 1 width<br>
p=finale.FCPart(0)<br>
p:ViewInDocument()<br>
meas=finale.FCMeasure(1)<br>
meas:Load(1)<br>
<b>meas.Width=meas.Width+1<br>
meas:Save()<br>
meas.Width=meas.Width-1<br>
meas:Save()</b><br>
print("Measure Width in Score",meas.Width)<br>
<br>
Jan<br>
<br>
<br>
<br>
<div>Am 03.04.2024 um 15:34 schrieb Robert
Patterson:<br>
</div>
<blockquote type="cite">
<div dir="ltr">This is a bug in Finale. I doubt it will be fixed.
But you could send it to them if you wish.<br>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Wed, Apr 3, 2024 at 7:53 AM
Jan Angermüller <<a href="mailto:jan@angermueller.com" target="_blank">jan@angermueller.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> Robert,<br>
<br>
I have noticed several times that undo-ing and re-doing a JW
Lua plug-in can change the measure width.<br>
Finally, I have created a short reproduceable demo that I
can't explain.<br>
<br>
The script is below.<br>
When applied to the score of the attached Finale file, it
switches to linked part 3, loads measure 1 and changes its
measure width to 360 and then returns to the score.<br>
The measure width in the score remains unchanged. So far,
everything ok.<br>
Then I undo the plug-in in Finale and click on Edit->Redo
...<br>
Now the width in measure 1 also changes in the score!<br>
<br>
Here is a video that shows the effect (with a slightly
different version of the score):<br>
<a href="https://www.youtube.com/watch?v=lPJd3sq9zQg" target="_blank">https://www.youtube.com/watch?v=lPJd3sq9zQg</a><br>
<br>
In Perfect Layout it makes Finale's Undo-/Redo feature
unusuable, because it (nearly) always changes the measure
widths in the score for an unknown reason.<br>
Do you have an idea how I can prevent this?<br>
<br>
Jan<br>
<br>
--Show measure 1 width from score<br>
local meas=finale.FCMeasure(1)<br>
meas:Load(1)<br>
print("Measure Width in Score",meas.Width)<br>
<br>
--Load Part 3 and change<br>
local p=finale.FCPart(3)<br>
p:SwitchTo(); <br>
p:ViewInDocument()<br>
meas=finale.FCMeasure(1)<br>
meas:Load(1)<br>
print("Measure Width in Part ",p.ID,meas.Width)<br>
meas.Width=360<br>
meas:Save()<br>
print("Measure Width after change",meas.Width)<br>
p:SwitchBack(); <br>
<br>
--Go back to score and show measure 1 width<br>
p=finale.FCPart(0)<br>
p:ViewInDocument()<br>
meas=finale.FCMeasure(1)<br>
meas:Load(1)<br>
print("Measure Width in Score",meas.Width)<br>
</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>
<br>
<fieldset></fieldset>
<pre>_______________________________________________
JWLua mailing list
<a href="mailto:JWLua@jwmusic.nu" target="_blank">JWLua@jwmusic.nu</a>
<a href="http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu" target="_blank">http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu</a>
</pre>
</blockquote>
<br>
<pre cols="72">--
Jan Angermüller
Orchideenstieg 13
22297 Hamburg
Tel. 040 - 28 94 84 82
Mobil 0173 - 99 33 904
<a href="http://www.elbsound.studio" target="_blank">www.elbsound.studio</a></pre>
</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>