<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Jari,<br>
    <br>
    thanks for your answer!<br>
    <br>
    Sorry to ask again, but what does it mean regarding my proposed
    "Delete parts" script?<br>
    Is it allowed to call it? I.e. although the Finale PDK doesn't offer
    a "Delete parts" function the script still deletes all the necessary
    data without causing problems.<br>
    Or is it "dangerous" to the Finale data? <br>
    Or is it unknown if it's ok or not? (i.e. better not use it...)<br>
    <br>
    Best,<br>
    Jan<br>
    <br>
    <div class="moz-cite-prefix">Am 15.08.2017 um 21:33 schrieb Jari
      Williamsson:<br>
    </div>
    <blockquote type="cite"
      cite="mid:6f7712a5-588a-70a8-35cd-64494582c688@mailbox.swipnet.se">Jan,
      <br>
      <br>
      Finale doesn't current provide delete of parts to the PDK. From a
      calling plug-in's viewpoint, there isn't any similarity between
      Finale data and parts, they are called very differently. It's just
      that I've tried parts and data to "behave" the same way in my PDK
      Framework (and in JW Lua), with LoadAll() and such stuff.
      <br>
      <br>
      <br>
      Best regards,
      <br>
      <br>
      Jari Williamsson
      <br>
      <br>
      On 2017-08-09 08:54, Jan Angermüller wrote:
      <br>
      <blockquote type="cite">Jari et al,
        <br>
        <br>
        what is the best way to delete all parts in a script?
        <br>
        <br>
        Do I need SwitchTo?    (both options seem to work)
        <br>
        Do I need DeepDeleteData or DeleteData?  (both options seem to
        work)
        <br>
        <br>
        The script below seems to delete the parts, but when I click on
        "Document->Edit Part->..." right after running the script
        it still lists all parts.
        <br>
        Only when I open Document->Manage Parts after running the
        script I see that all parts have been deleted. And after looking
        into Manage Parts "Document->Edit Part->..." also has
        cleared its list.
        <br>
        So I am not sure, if everything was really deleted correctly
        through the script.
        <br>
        It could also be that this is a Finale bug: the menu structure
        ("Document->Edit Part") is not updated correctly or at all
        through a plugin call.
        <br>
        <br>
        Code snippet:
        <br>
        local parts=finale.FCParts()
        <br>
        parts:LoadAll()
        <br>
        for p in eachbackwards(parts) do
        <br>
             if p.ID~=finale.PARTID_SCORE then
        <br>
                 p:SwitchTo()
        <br>
                     p:DeepDeleteData()
        <br>
                 p:SwitchBack()
        <br>
             end
        <br>
        end
        <br>
        <br>
        Best,
        <br>
        Jan
        <br>
        <br>
        <br>
        _______________________________________________
        <br>
        JWLua mailing list
        <br>
        <a class="moz-txt-link-abbreviated" href="mailto:JWLua@jwmusic.nu">JWLua@jwmusic.nu</a>
        <br>
        <a class="moz-txt-link-freetext" href="http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu">http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu</a>
        <br>
        <br>
      </blockquote>
      <br>
      <br>
      <br>
      _______________________________________________
      <br>
      JWLua mailing list
      <br>
      <a class="moz-txt-link-abbreviated" href="mailto:JWLua@jwmusic.nu">JWLua@jwmusic.nu</a>
      <br>
      <a class="moz-txt-link-freetext" href="http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu">http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu</a>
      <br>
    </blockquote>
    <br>
  </body>
</html>