<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Jari,<br>
     <br>
    the document under the following link crashes when I call
    InsertEntriesAfter (tested on Windows 10/Finale 2014):<br>
    <a class="moz-txt-link-freetext" href="https://elbsound.studio/img/sl4.musx">https://elbsound.studio/img/sl4.musx</a>       <br>
    <br>
    Code snippet:<br>
    local region=finale.FCMusicRegion()<br>
    region:SetFullDocument()<br>
    noteentrylayerdest=finale.FCNoteEntryLayer(2,region.StartStaff,1,1)
    --insert on layer 3 first staff measure 1<br>
    if noteentrylayerdest:Load()<br>
        and (noteentrylayerdest.Count==0) then --only insert if frame is
    empty<br>
        local newentry=noteentrylayerdest:InsertEntriesAfter(nil,1)<br>
    end<br>
    <br>
    I assume that there is something corrupt with the document - as can
    be seen by the 500 KB file size (although I haven't noticed any
    other weird behaviours with this document). But: it would be great
    if Finale didn't crash in this case, but JW Lua would return a nil
    value, if it noticed any problems.<br>
    If you run the same script on Finale's default document, it works
    fine (though it doesn't do anything yet as the new frame isn't saved
    in the code snippet).<br>
    <br>
    Best regards,<br>
    Jan<br>
  </body>
</html>