[JW Lua] FCPageTexts - Retrieve Item at a specific index
Jari Williamsson
jari.williamsson at mailbox.swipnet.se
Sat Nov 29 17:46:32 CET 2014
Bruce,
You're correct about how the ItemCmper/ItemInci works in connection with
FCPageText. However, you should rarely need to know that for most kind
of script programming. :-)
In your first message, you said you wanted to iterate through all the
page text. This is done with something similar to:
---
local pagetexts = finale.FCPageTexts()
pagetexts:LoadAll()
for ptext in each(pagetexts) do
local rawstr = ptext:CreateTextString()
print("First page:", ptext.FirstPage, "Last page:", ptext.LastPage,
"Raw string:", rawstr.LuaString)
end
---
It's not possible to locate text block data in any pre-determined order.
Data is added/removed as required in the order the user decides to do it.
Best regards,
Jari Williamsson
On 2014-11-29 05:45, Bruce Olson wrote:
> Hi Jari,
>
> I’ve been poking around in the list archives and found this reply from you
> in two messages to Charles:
>
> -- The record location for certain types of data. I added that so it would
> -- be possible to see the storage location on existing instances of
> -- FCPageText, for example. ItemCmper would be the same as the value you
> -- send to FCPageText:SaveNew(). ItemInci is the 0-based "record index"
> -- within the ItemCmper.
> -- In what scope? In the FCPageText scope, ItemCmper would be the page
> -- number and ItemInci would be the subrecord number for objects stored on
> -- that page:
> -- http://www.finaletips.nu/frameworkref/class_____f_c_inci_other.html
>
> This is getting me closer, but ItemCmper is the Page # only for single page
> items. It seems to be set to 0 for page ranges. Is that right? So that leads
> me to thinking that I should be using Load(<arguments>) to get a specific
> one, but I haven't quite figured out what the syntax should be.
>
> --
> Regards,
> Bruce
>
> From: JWLua [mailto:jwlua-bounces at jwmusic.nu] On Behalf Of
> Finale at web.yosound.com
> Sent: Friday, November 28, 2014 3:03 PM
> To: JWLua at jwmusic.nu
> Subject: [JW Lua] FCPageTexts - Retrieve Item at a specific index
>
> Hi Jari,
>
> I am trying to iterate through all of the Page Text items in order to either
> update them or add them if they are missing in a document. This is in order
> to give a standard look to all the charts I write for my big band. I think
> what I should be using is GetItemAt, but am stuck trying to implement it.
>
> My process is to first iterate through all of them and modify a table with a
> flag to indicate that it exists by inserting an ID. I thought that ItemCmper
> and ItemInci were what I should use, but was wondering if there is an easier
> way.
>
>
>
> _______________________________________________
> JWLua mailing list
> JWLua at jwmusic.nu
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
>
>
More information about the JWLua
mailing list