<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
{font-family:Roboto;
panose-1:2 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle22
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple style='word-wrap:break-word'><div class=WordSection1><p class=MsoNormal>Hi Jan,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>It works!<o:p></o:p></p><p class=MsoNormal>----------------------------<o:p></o:p></p><p class=MsoNormal><span style='color:#2F5597;mso-style-textfill-fill-color:#2F5597;mso-style-textfill-fill-alpha:100.0%'>local pagetexts=finale.FCPageTexts()<o:p></o:p></span></p><p class=MsoNormal><span style='color:#2F5597;mso-style-textfill-fill-color:#2F5597;mso-style-textfill-fill-alpha:100.0%'>pagetexts:LoadAll() <o:p></o:p></span></p><p class=MsoNormal><span style='color:#2F5597;mso-style-textfill-fill-color:#2F5597;mso-style-textfill-fill-alpha:100.0%'>local ptable = {}<o:p></o:p></span></p><p class=MsoNormal><span style='color:#2F5597;mso-style-textfill-fill-color:#2F5597;mso-style-textfill-fill-alpha:100.0%'>for p in each(pagetexts) do<o:p></o:p></span></p><p class=MsoNormal><span style='color:#2F5597;mso-style-textfill-fill-color:#2F5597;mso-style-textfill-fill-alpha:100.0%'> table.insert(ptable, {p.ItemCmper,p.ItemInci})<o:p></o:p></span></p><p class=MsoNormal><span style='color:#2F5597;mso-style-textfill-fill-color:#2F5597;mso-style-textfill-fill-alpha:100.0%'>end<o:p></o:p></span></p><p class=MsoNormal><span style='color:#2F5597;mso-style-textfill-fill-color:#2F5597;mso-style-textfill-fill-alpha:100.0%'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#2F5597;mso-style-textfill-fill-color:#2F5597;mso-style-textfill-fill-alpha:100.0%'>local pagetext=finale.FCPageText()<o:p></o:p></span></p><p class=MsoNormal><span style='color:#2F5597;mso-style-textfill-fill-color:#2F5597;mso-style-textfill-fill-alpha:100.0%'>for i = #ptable, 1, -1 do<o:p></o:p></span></p><p class=MsoNormal><span style='color:#2F5597;mso-style-textfill-fill-color:#2F5597;mso-style-textfill-fill-alpha:100.0%'> pagetext:Load(ptable[i][1], ptable[i][2])<o:p></o:p></span></p><p class=MsoNormal><span style='color:#2F5597;mso-style-textfill-fill-color:#2F5597;mso-style-textfill-fill-alpha:100.0%'> pagetext:DeleteData()<o:p></o:p></span></p><p class=MsoNormal><span style='color:#2F5597;mso-style-textfill-fill-color:#2F5597;mso-style-textfill-fill-alpha:100.0%'> end</span><o:p></o:p></p><p class=MsoNormal>-----------------------------<o:p></o:p></p><p class=MsoNormal>One obvious error in my original code was that Load() needed to be invoked *<b>inside</b>* the deletion loop, not outside.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>For my further education: It only works if you load the item using not only its Cmper index, but also something called “Inci” which I am not familiar with. The docs are terse:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>“<span style='font-size:10.5pt;font-family:Roboto;color:black'>Returns the inci (subrecord) value in the data ID for a loaded record.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Roboto;color:black'>“The inci value is the 0-based record within the cmper.”<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Roboto;color:black'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Roboto;color:black'>Can you explain? (This could save me a lot of time and reduce the number of questions I ask here….). <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Roboto;color:black'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Roboto;color:black'>Many thanks.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Roboto;color:black'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Roboto;color:black'>Martin Marris<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Roboto;color:black'><o:p> </o:p></span></p></div></body></html>