[JW Lua] Creating a new Expression Category
Robert Wildling
robertwildling at gmail.com
Wed May 11 15:38:34 CEST 2016
Thanks, Jan!
(Why do I not receive an email, when you post your answer? hmmm...)
Does this also mean that I cannot move around TextExpressionDefs from one
Cat to another? Provided that I can check whether the item is used in the
score or not (which I still didn't find the proper method for...)
Best,
Robert
2016-05-11 13:56 GMT+02:00 Robert Wildling <robertwildling at gmail.com>:
> 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/0d4f4d61/attachment.htm>
More information about the JWLua
mailing list