[JW Lua] Expression Categories

Dave Foster fozder at me.com
Thu Oct 24 15:28:57 CEST 2013


Hi Jari & all,

Messing around today with expression categories - having a lot of success with setting default fonts etc. I'm struggling, though, once I've set the default fonts for a category, to get expressions where "Use … Category Fonts" is selected to update to the new fonts. It appears to have set it when looking at the definition but the text itself hasn't updated. Might this be a case where something needs to be updated internally, or is there some save or update method that I've missed? Here's some example code - try it on a default score where the Tempo Marks have been set to "Use Tempo Marks Category Fonts":

local expCats = finale.FCCategoryDefs()
local returnNumber
expCats:LoadAll()
for expCat in each(expCats) do
	local title = expCat:CreateName()
	if (title:IsEqual("Tempo Marks")) then
		local fontInfo = finale:FCFontInfo()
		fontInfo.Name = "Arial Black"
		fontInfo:SetBold(false) -- can't use dot setters for Bold?
		fontInfo:SetItalic(true) -- or Italic?
		fontInfo.Size = 14
		fontInfo.Absolute = absolute
		expCat:SetTextFontInfo(fontInfo)
		expCat:Save()
	end
end

Cheers,

Dave



More information about the JWLua mailing list