<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi again Chris,<div class=""><br class=""></div><div class="">I ran it in Finale 25 on a Mac without any problem. I did a few tests and it seems to be working very well.</div><div class="">Great job by the way!</div><div class=""><br class=""></div><div class="">I’ll try it later on other versions of Finale to see if I can reproduce the problem you mentionned.</div><div class=""><br class=""></div><div class="">Second part: I just was able to reproduce the problem in Finale 25.</div><div class=""><br class=""></div><div class="">One thing that I noticed, and it might be different on Windows: In Finale, when you call  FCDocuments:LoadAll(),</div><div class="">Finale will keep in memory the same document as different entries if it has been opened several times within the same session (without quitting Finale).</div><div class="">The right file is always the last one on the list with that name, where those repetitions appears. So even if you have only 2 files opened, Finale may return more as “opened documents”. I overcame that problem by adding a line that tells Lua to replace the value of that key if it encounters the same value twice or more with the last similar entry.</div><div class=""><br class=""></div><div class="">Right now, it does not explain your “Untitled (id = 3)” , I would need to look a little bit closer at your script, but I’m sure it has to do with the way those documents are called. You could tell it not to consider the file if has that name (a workaround for the moment).</div><div class=""><br class=""></div><div class="">I’ll look into it a little bit more later today, but here is a snapshot of what I see, eventhough I have only 2 documents opened (notice that the file “Template.musx” appears twice, eventhough only one version of the file is actually opened):</div><div class=""><br class=""></div><div class=""><img apple-inline="yes" id="310438F4-BEF7-4E2A-973D-60917AAE3728" src="cid:F95F2FC6-588E-40F5-9B8D-16290670278D@cgocable.ca" class=""></div><div class=""><br class=""></div><div class="">Hoping this gives you a hint to solve the problem.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Nov 28, 2017, at 9:51 AM, Chris <<a href="mailto:marcel.denio@gmail.com" class="">marcel.denio@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">
  

    <meta http-equiv="content-type" content="text/html; charset=utf-8" class="">
  
  <div text="#000000" bgcolor="#FFFFFF" class="">
    <span id="result_box" class="short_text" lang="en"><span class="">Thank
        you all<br class="">
        <br class="">
        Simon : </span></span><span id="result_box" class="short_text" lang="en"><span class="">I join my script<br class="">
        Bart :  </span></span><span id="result_box" class="short_text" lang="en"><span class="">it may be the explanation<br class="">
        Jan : </span></span><span id="result_box" class="short_text" lang="en"><span class=""><span id="result_box" class="short_text" lang="en"><span class="">the script is running twice<br class="">
            <br class="">
            Chris<br class="">
          </span></span></span></span><span id="result_box" class="short_text" lang="en"><span class=""></span></span><span id="result_box" class="short_text" lang="en"><span class=""></span></span>
  </div>

<span id="cid:A529154D-E7FA-42EA-BD65-BDE7D57444C2@cgocable.ca"><copie_mise_en_page.zip></span>_______________________________________________<br class="">JWLua mailing list<br class=""><a href="mailto:JWLua@jwmusic.nu" class="">JWLua@jwmusic.nu</a><br class="">http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu<br class=""></div></blockquote></div><br class=""><div class="">
<span class="Apple-style-span" style="font-variant-ligatures: normal; font-variant-position: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; line-height: normal; border-collapse: separate; border-spacing: 0px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class="Apple-interchange-newline"><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Simon Leclerc</div><div class="">60, Mirabelle</div><div class="">Ste-Agathe-des-Monts, Québec</div><div class="">J8C 0W9</div><div class=""><a href="mailto:simon@prodsl.ca" class="">simon@prodsl.ca</a></div><div class=""><br class=""></div></div></span><br class="Apple-interchange-newline" style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class="Apple-interchange-newline">
</div>
<br class=""></div></body></html>