[JW Lua] Creating a new Expression Category

Robert Wildling robertwildling at gmail.com
Wed May 11 13:56:18 CEST 2016


Hi,

I am looking for a way to create a new Expression Category withe the name
of "unused" (the intention is to move all unused textExprDefs and
ShaeexprDefs to that category).

Starting out, I thought, this can only be done via selecting a specific
category and saving it using "SaveAs" and a new "ItemNo", like this:

``[lua]
local dynCat = finale.FCCategoryDef()
if dynCat:Load(2) then
    -- get the category name
    local catName = finale.FCString()
    dynCat:GetName(catName)

    -- save it anew
    dynCat:SaveNew()

     -- shows tha a new item number
    -- was generated (65535 ??? looks like an error...)
    print(dynCat:GetItemNo())
end
``

But even though the category is assigned a new number (is 65535 an
indicator for an error here? look strange), no new category was created.
And if the ItemNo of the original category was changed, a second
run-through shouldn't work, since Load(2) shouldn't find anything at that
position... but it does...

I am very confused... any hints and/or help would be much appreciated!
Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20160511/42fed95e/attachment.html>


More information about the JWLua mailing list