<div dir="ltr"><div>Unfortunately, this may be a bug in either JW Lua or Finale. It may also be limited to Windows Finale. I have no personal experience with it, because I have never used the underlying API calls in the PDK. It is unfortunate that the PDK Framework does not provide a way to call the Copy/Paste menu items in the Edit menu. This is what I would do if programming directly to the PDK. (I don't trust the Copy/Paste APIs because I don't think they get much use, and they use clip files.)</div><div><br></div><div>You could try creating the directory it wants to write the clip files in. Maybe that would help. IDK.</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Dec 14, 2020 at 1:47 PM Martin Marris <<a href="mailto:mmarris@notecraft.com">mmarris@notecraft.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 style="overflow-wrap: break-word;" lang="EN-US"><div class="gmail-m_-5653670863253836899WordSection1"><p class="MsoNormal">Hi Robert,<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Do you mean like this? It’s not working, I get a variant of the same message box error notification:<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><span style="color:rgb(197,90,17)">local musicregion = finale.FCMusicRegion()<u></u><u></u></span></p><p class="MsoNormal"><span style="color:rgb(197,90,17)"><u></u> <u></u></span></p><p class="MsoNormal"><span style="color:rgb(197,90,17)">musicregion.StartMeasure = 1<u></u><u></u></span></p><p class="MsoNormal"><span style="color:rgb(197,90,17)">musicregion.EndMeasure = 2<u></u><u></u></span></p><p class="MsoNormal"><span style="color:rgb(197,90,17)">musicregion:SetInDocument() <u></u><u></u></span></p><p class="MsoNormal"><span style="color:rgb(197,90,17)">musicregion:CopyMusic()<u></u><u></u></span></p><p class="MsoNormal"><span style="color:rgb(197,90,17)"><u></u> <u></u></span></p><p class="MsoNormal"><span style="color:rgb(197,90,17)">musicregion.StartMeasure = 3<u></u><u></u></span></p><p class="MsoNormal"><span style="color:rgb(197,90,17)">musicregion.EndMeasure = 4<u></u><u></u></span></p><p class="MsoNormal"><span style="color:rgb(197,90,17)">musicregion:SetInDocument() <u></u><u></u></span></p><p class="MsoNormal"><span style="color:rgb(197,90,17)">musicregion:PasteMusic()<u></u><u></u></span></p><p class="MsoNormal"><span style="color:rgb(197,90,17)"><u></u> <u></u></span></p><p class="MsoNormal"><span style="color:rgb(197,90,17)">musicregion:ReleaseMusic()</span><u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Martin<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><div style="border-color:rgb(225,225,225) currentcolor currentcolor;border-style:solid none none;border-width:1pt medium medium;padding:3pt 0in 0in"><p class="MsoNormal"><b>From:</b> JWLua <<a href="mailto:jwlua-bounces@jwmusic.nu" target="_blank">jwlua-bounces@jwmusic.nu</a>> <b>On Behalf Of </b>Robert Patterson<br><b>Sent:</b> Monday, December 14, 2020 19:36<br><b>To:</b> The JW Lua script plug-in. <<a href="mailto:jwlua@jwmusic.nu" target="_blank">jwlua@jwmusic.nu</a>><br><b>Subject:</b> Re: [JW Lua] Copy/Paste With FCMusicRegion()<u></u><u></u></p></div><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">Try calling musicregion:SetInDocument() after setting the start and end measures (both times).<u></u><u></u></p></div><p class="MsoNormal"><u></u> <u></u></p><div><div><p class="MsoNormal">On Mon, Dec 14, 2020 at 1:18 PM Martin Marris <<a href="mailto:mmarris@notecraft.com" target="_blank">mmarris@notecraft.com</a>> wrote:<u></u><u></u></p></div><blockquote style="border-color:currentcolor currentcolor currentcolor rgb(204,204,204);border-style:none none none solid;border-width:medium medium medium 1pt;padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in"><div><div><p class="MsoNormal">I am trying to create a Region programmatically (rather than through user interaction).<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal">Then, copy/paste between regions.<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal">But if I run the following simple script:<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal"><span style="color:rgb(197,90,17)">local musicregion = finale.FCMusicRegion()</span><u></u><u></u></p><p class="MsoNormal"><span style="color:rgb(197,90,17)">musicregion.StartMeasure = 1</span><u></u><u></u></p><p class="MsoNormal"><span style="color:rgb(197,90,17)">musicregion.EndMeasure = 2</span><u></u><u></u></p><p class="MsoNormal"><span style="color:rgb(197,90,17)">musicregion:CopyMusic()</span><u></u><u></u></p><p class="MsoNormal"><span style="color:rgb(197,90,17)">musicregion.StartMeasure = 3</span><u></u><u></u></p><p class="MsoNormal"><span style="color:rgb(197,90,17)">musicregion.EndMeasure = 4</span><u></u><u></u></p><p class="MsoNormal"><span style="color:rgb(197,90,17)">musicregion:PasteMusic()</span><u></u><u></u></p><p class="MsoNormal"><span style="color:rgb(197,90,17)">musicregion:ReleaseMusic()</span><u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal">I get this result:<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal">Message box:<span style="color:rgb(197,90,17)"> Title “Finale” and text “Cannot read library c:\users\myusername\AppDate\LocalLow\Fin33B.tmp”.</span><u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal">Why?<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal">Martin<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p></div></div><p class="MsoNormal">_______________________________________________<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/listinfo/jwlua_jwmusic.nu</a><u></u><u></u></p></blockquote></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>