[JW Lua] Deleting all parts

Jan Angermüller jan at angermueller.com
Wed Aug 16 12:30:14 CEST 2017


Jari,

thanks for your answer!

Sorry to ask again, but what does it mean regarding my proposed "Delete 
parts" script?
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.
Or is it "dangerous" to the Finale data?
Or is it unknown if it's ok or not? (i.e. better not use it...)

Best,
Jan

Am 15.08.2017 um 21:33 schrieb Jari Williamsson:
> 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
>>
>
>
>
> _______________________________________________
> JWLua mailing list
> JWLua at jwmusic.nu
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20170816/0d0a2100/attachment.htm>


More information about the JWLua mailing list