[JW Lua] Deleting all parts

Jari Williamsson jari.williamsson at mailbox.swipnet.se
Tue Aug 15 21:33:42 CEST 2017


Jan,

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.


Best regards,

Jari Williamsson

On 2017-08-09 08:54, Jan Angermüller wrote:
> Jari et al,
> 
> what is the best way to delete all parts in a script?
> 
> Do I need SwitchTo?    (both options seem to work)
> Do I need DeepDeleteData or DeleteData?  (both options seem to work)
> 
> 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.
> 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.
> So I am not sure, if everything was really deleted correctly through the 
> script.
> 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.
> 
> Code snippet:
> local parts=finale.FCParts()
> parts:LoadAll()
> for p in eachbackwards(parts) do
>      if p.ID~=finale.PARTID_SCORE then
>          p:SwitchTo()
>              p:DeepDeleteData()
>          p:SwitchBack()
>      end
> end
> 
> Best,
> Jan
> 
> 
> _______________________________________________
> JWLua mailing list
> JWLua at jwmusic.nu
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
> 






More information about the JWLua mailing list