[JW Lua] Deleting Page Text

Martin Marris mmarris at notecraft.com
Wed Dec 9 09:03:05 CET 2020


Hi Jan,

 

It works!

----------------------------

local pagetexts=finale.FCPageTexts()

pagetexts:LoadAll()           

local ptable = {}

for p in each(pagetexts) do

    table.insert(ptable, {p.ItemCmper,p.ItemInci})

end

 

local pagetext=finale.FCPageText()

for i = #ptable, 1, -1 do

      pagetext:Load(ptable[i][1], ptable[i][2])

      pagetext:DeleteData()

end

-----------------------------

One obvious error in my original code was that Load() needed to be invoked
*inside* the deletion loop, not outside.

 

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:

 

"Returns the inci (subrecord) value in the data ID for a loaded record.

"The inci value is the 0-based record within the cmper."

 

Can you explain? (This could save me a lot of time and reduce the number of
questions I ask here..). 

 

Many thanks.

 

Martin Marris

 

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


More information about the JWLua mailing list