[JW Lua] Creating a new expression category

Jari Williamsson jari.williamsson at mailbox.swipnet.se
Tue Jan 28 18:11:40 CET 2014


Jan,

By design, Finale prevents the PDK layer to create new categories or 
delete them. And BTW, there is one other data structure I know of that 
has the same limitation: that's the creation of new multi-instrument 
groups (for Score Manager) which Finale also prevents.

Best regards,

Jari Williamsson


On 2014-01-28 16:53, Jan Angermüller wrote:
> Hi Jari,
>
> I am trying to create a new expression category,
> but don't have success with saving it.
>
> Apart from many other solutions I tried
> this is the one that I most believe in ;-),
> but it still doesn't work. "SaveNew()" returns false.
>
>
>
> local catdef = finale.FCCategoryDef()
> catdef:SetUserCreated(true)
> local textfontinfo = catdef:CreateTextFontInfo()
> local musicfontinfo = catdef:CreateTextFontInfo()
> catdef:SetTextFontInfo(textfontinfo)
> catdef:SetMusicFontInfo(musicfontinfo)
>
> local textstr = finale.FCString()      -- Make category name
> textstr.LuaString = "New Category"
> catdef:SetName(textstr)
>
> catdef:SetID(8)  -- first free category ID (1-7 are occupied with the
> default IDs)
> if catdef:SaveNew() then
>     print("Save successful:",catdef:CreateName().LuaString)
> else print("Save not successful")
> end
>
>
> Any ideas ? Or is it not possible yet ?
>
> I also tried it without the SetID because it says in the documentation
> "the data will not save if the id is changed. " But still no save success.
>
> And I also tried within the collection FCCategoryDefs(), but the collection
> does not have an insert or add-function, so I think it can't be included
> on this way.
>
> Best,
> Jan
>
> _______________________________________________
> JWLua mailing list
> JWLua at jwmusic.nu
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
>
>






More information about the JWLua mailing list