<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
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>
</body>
</html>