[JW Lua] Creating a text expression category

Bart Visser bartvisser at me.com
Wed Oct 21 21:30:28 CEST 2015


Hi Charles,

Maybe this is helpful:


function CreateRehearsalExpression(expressionTextAsLuaString, descriptionAsLuaString)
	if DEBUG then print("---- function AddRehearsalExpression") end
	
	
	local expressionString = finale.FCString()
	expressionString.LuaString = expressionTextAsLuaString
	
	local descriptionStr = finale.FCString()
	descriptionStr.LuaString = descriptionAsLuaString
	
	
	local newExpression = finale.FCTextExpressionDef()
	newExpression.UseCategoryFont = false
	newExpression:SaveNew()
	newExpression:SaveNewTextBlock(expressionString)
	newExpression.CategoryID = 6 -- Rehearsal category
	newExpression.RehearsalMarkStyle = 5
	newExpression.UseCategoryPos = false
	newExpression.UseCategoryFont = false
	newExpression.HorizontalOffset = -100
	newExpression.HorizontalAlignmentPoint = 0
	newExpression.VerticalAlignmentPoint = 3 -- Staff Reference Line
	newExpression.VerticalBaselineOffset = -60
	newExpression:SetDescription(descriptionStr)
	newExpression:Save()
	return newExpression
end

function AddExpressionToScore(staffNo, measureNo, expressionID)
	local staff = staff or 1
	local expression = finale.FCExpression()
	expression:SetStaff(staffNo)
	expression:SetVisible(true)
	expression:SetLayerAssignment(0)
	expression:SetID(expressionID)
	local cell = finale.FCCell(measureNo, staffNo)
	expression:SaveNewToCell(cell)
end


-- 1. Create newExpressionDef
local newExpression = CreateRehearsalExpression("Expression Text", "Description Text")

-- 2. Add it to staff 1, measure 3
AddExpressionToScore(1, 3, newExpression.ItemNo)

Cheers,


Bart Visser




> Op 21 okt. 2015, om 20:40 heeft Charles O. Lawrence <charlesolawrence at bellsouth.net> het volgende geschreven:
> 
> Thanks Jan.  That might explain why I cannot find a method to create one.  Do you know how to create a new text expression?  I’m struggling with that too.
>  
> Charles
>  
>  
>  
> From: JWLua [mailto:jwlua-bounces at jwmusic.nu] On Behalf Of Jan Angermüller
> Sent: Wednesday, October 21, 2015 2:11 PM
> To: The JW Lua script plug-in. <jwlua at jwmusic.nu>
> Subject: Re: [JW Lua] Creating a text expression category
>  
> If I remember it correctly, Jari mentioned somewhere that new expression categories can't be created yet.
> 
> Jan
> 
> 
> Am 21.10.2015 um 19:03 schrieb Charles O. Lawrence:
>> JW Lua fans,
>>  
>> I am having difficulty creating a new text expression category.  Can anyone shed some light on the subject?  A code example would be greatly appreciated.
>>  
>> Thanks,
>> Charles
>> 
>> 
>> 
>> _______________________________________________
>> JWLua mailing list
>> JWLua at jwmusic.nu
>> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
>  
> _______________________________________________
> JWLua mailing list
> JWLua at jwmusic.nu
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu





More information about the JWLua mailing list