<div dir="ltr"><div>I just tried running your script without modifications and it detected the FCAccidentalMod just fine. Steps:</div><div><br></div><div>1. Open accidtest.musx</div><div>2. Open JW Lua and paste in your script.</div><div>3. Run it . (Nothing detected.)</div><div>4. Move one of the accidentals.</div><div>5. Run it. (Detected.)</div><div><br></div><div>I then modified your script slightly to use a separate accmod2 for the 2nd note. This works better. It looks like FCAccidentalMod doesn't work quite right if you LoadAt for one note then reuse the same instance to LoadAt another note.</div><div><br></div><div>I'm wondering if your basic problem is that after saving the accimod you are not setting the entry's note flag. (There is a function to do this.) Generally speaking, you can find out what your code is not doing by using the text dump plugin to compare a manual change in Finale with your script's changes. If you make the exact same manual change as you want from your script, you can find out any discrepancies.</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jul 8, 2020 at 8:31 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">
  

    
  
  <div>
    Thanks a lot, Robert, for you super quick replies!<br>
    <div> <br>
      But can I detect this automatically in JW Lua? Maybe you use other
      functions/flags in your plug-in?<br>
      <br>
      When I run this JW Lua code, it always return false when trying to
      load an accidental mod.<br>
      So I haven't been able to detect an existing accidental mod here.<br>
      <br>
      for e in eachentry(finenv.Region()) do<br>
          if not e:IsRest() then<br>
              local accmod=finale.FCAccidentalMod()<br>
              accmod:SetNoteEntry(e)<br>
              local note=e:GetItemAt(0)<br>
              print(accmod:LoadAt(note))<br>
              print(accmod.HorizontalPos)<br>
              note=e:GetItemAt(1)<br>
              print(accmod:LoadAt(note))<br>
              print(accmod.HorizontalPos)<br>
          end<br>
      end<br>
      <br>
      Best,<br>
      Jan<br>
      <br>
      <br>
      <br>
      <div>Am 08.07.2020 um 15:21 schrieb Robert
        Patterson:<br>
      </div>
      <blockquote type="cite">
        
        <div dir="ltr">
          <div>This is a perfect use case for the Enigma Text Dump
            plugin I sent out a couple of days ago.</div>
          <div><br>
          </div>
          <div>1. Dump your accidtest.musx file using the plugin.</div>
          <div>2. Nudge an accidental right then left, so its position
            is unchanged.</div>
          <div>3. Dump the file again using the plugin.</div>
          <div>4. Compare.</div>
          <div><br>
          </div>
          <div>I just did it, to make sure it works, but I already knew
            the answer. This behavior of accidentals had a subtle change
            around 2000. I don't remember the exact date. If the handle
            is on the left, it means there is no FCAccidentalMod detail
            for that note. If it is on the right, it means there is.</div>
          <div><br>
          </div>
          <div>You can use the same process as above to determine what
            your offsets need to be.</div>
          <div><br>
          </div>
          <div>1. Dump your original accidtest.musx file using the
            plugin.</div>
          <div>2. Place the accidental where you want it to be.</div>
          <div>3. Dump the file again using the plugin.</div>
          <div>4. Compare</div>
          <div><br>
          </div>
          <div>I hope this helps.</div>
          <div><br>
          </div>
          <div><br>
          </div>
        </div>
        <br>
        <div class="gmail_quote">
          <div dir="ltr" class="gmail_attr">On Wed, Jul 8, 2020 at 8:05
            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> Jari et al.,<br>
              <br>
              here is a weird accidental movement behaviour.<br>
              <br>
              When I use the Accidental Mover tool (or FCAccidentalMod
              -> HorizontalPos) and change the horizontal position to
              a new value, the accidental jumps onto the notehead (!)
              and takes the notehead as a new reference position.<br>
              This Finale document was created with Fin2002a.<br>
              The normal behaviour is that the change of the horizontal
              position keeps the reference position (i.e. far before the
              notehead) and moves only according to the new value.<br>
              <br>
              See this video:<br>
              First the weird behaviour, then the normal behaviour (in
              the Fin2014 default document):<br>
              <a href="https://www.youtube.com/watch?v=wRLsU40Kog8" target="_blank">https://www.youtube.com/watch?v=wRLsU40Kog8</a><br>
              <br>
              While making this video I also noticed, that sometimes the
              anchor point changed (!).<br>
              So maybe there used to be a flag in Finale (<=2002)
              which changed the alignment point of the accidental.<br>
              Have a look at the 23. second in this video: I click on
              the anchor point and it suddenly jumps from the right of
              the accidental to the left of the accidental.<br>
              <a href="https://www.youtube.com/watch?v=6EjOfAlhwMM#t=20s" target="_blank">https://www.youtube.com/watch?v=6EjOfAlhwMM#t=20s</a><br>
              When the anchor point jumps (but this only happens very
              seldom, and I can't reproduce it) and I check the
              FCAccidentalMod it suddenly returns a -54 EVPU value for
              HorizontalPos. While by default (when the anchor point
              hasn't jump before) it returns no existing accidental mod
              and thus a 0 EVPU value.<br>
              <br>
              I haven't found a way to detect or to remove this
              behaviour yet. Probably it's not even possible.<br>
              Attached is the document with the measure from the video
              where this weird thing happens.<br>
              <br>
              Any ideas?<br>
              The only thing that came to mind: it was created with
              Fin2002a. <br>
              Maybe this was a bug in Fin2002a which they fixed in
              2002b? <br>
              Or this was something available before 2002, but not
              supported anymore.<br>
              <br>
              Best,<br>
              Jan<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
Dipl.-Ing.(FH) Dipl.-Jur. 
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>
  </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>