[JW Lua] Creating Rehearsal Marker Expression Definition

Jan Angermüller jan at angermueller.com
Mon Apr 11 22:11:29 CEST 2016


 >The CreateEnclosure() always returns a nil value.
As it says in the  CreateEnclosure documentation: NULL if the expression 
doesn't have an enclosure or if the data couldn't be loaded. It simply 
doesn't have an enclosure when it's a newly created expression. The 
function is needed to manipulate an existing one.
For a new creation I already mentioned in my last mail 
FCEnclosure:SaveNew(...).
You need it to connect the FCEnclosure to the FCTextExpressionDef. 
Although I haven't tested it yet.

Jan



Am 11.04.2016 um 21:53 schrieb Charles O. Lawrence:
>
> Gentlemen,
>
> I still cannot seem to get the enclosure to work.  What am I missing?  
> The CreateEnclosure() always returns a nil value.  Also, as previously 
> mentioned, for some reason, I am not getting emails from the forum any 
> more.  I have not done anything to change my membership properties.
>
> Thanks
>
> ----------
>
> function CreateMeasureNumberExpressionDef(expressionTextAsLuaString, 
> descriptionAsLuaString)
>
>     -- setup the font
>
>                 local fontPrefs = finale.FCFontPrefs()
>
>     local fontInfo = finale.FCFontInfo()
>
> fontPrefs:Load(finale.FONTPREF_EXPRESSION)
>
>     fontPrefs:GetFontInfo(fontInfo)
>
>     fontInfo.Name = fontName
>
>     fontInfo.Size = fontSize
>
>     fontInfo.Bold = fontBold
>
>     fontPrefs:SetFontInfo(fontInfo)
>
>     fontPrefs:Save()
>
>                 local expressionString = finale.FCString()
>
>                 expressionString.LuaString = expressionTextAsLuaString
>
>                 local descriptionStr = finale.FCString()
>
>                 descriptionStr.LuaString = descriptionAsLuaString
>
>     -- create the expression def
>
>                 local newExpression = finale.FCTextExpressionDef()
>
> newExpression:SaveNewTextBlock(expressionString)
>
>                 newExpression.CategoryID = 
> finale.DEFAULTCATID_REHEARSALMARK
>
>     newExpression.RehearsalMarkStyle = finale.REHMARKSTYLE_MEASNUM
>
> newExpression.UseCategoryPos = false
>
> newExpression.UseCategoryFont = false
>
> newExpression:SetDescription(descriptionStr)
>
>     -- setup the enclosure
>
>                 newExpression.UseEnclosure = true
>
>     enc = newExpression:CreateEnclosure()
>
>     --enc.Shape = finale.ENCLOSURE_RECTANGLE
>
>     -- save the expression def
>
>                 newExpression:SaveNew()
>
> end
>
> fontName = "Engravers MT"
>
> fontSize = 18
>
> fontBold = true
>
> --^font(Engravers MT,8192)^size(18)^nfx(1)^rehearsal()
>
> CreateMeasureNumberExpressionDef("^rehearsal()","myAuto-Sequencing 
> Measure Number Rehearsal Markers")
>
>
>
> _______________________________________________
> JWLua mailing list
> JWLua at jwmusic.nu
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20160411/022c49f0/attachment.html>


More information about the JWLua mailing list