[JW Lua] Creating Rehearsal Marker Expression Definition

Charles O. Lawrence charlesolawrence at bellsouth.net
Mon Apr 11 21:53:03 CEST 2016


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")

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20160411/660f6c11/attachment.htm>


More information about the JWLua mailing list