Hi Sander,
I'm only just dipping into lua so there is probably a "right" way to do this, rather than my kludge - I needed to programatically change the font, font size and line spacing in a pre-existing comp. I put the following into a lua script with the extension .lua.scriptlib in the scripts/comp folder so it would run automatically when I opened a comp.
- Code: Select all
-- get a list of Text+
texts=comp:GetToolList(false,"TextPlus")
count=0
for i, tool in pairs(texts) do
-- do I need to do this?
old=tool
-- check to see if it has the font we want to change...
if (old:GetInput("Font")=="High Sans Serif 7") then
-- if yes, then change font, size and line spacing
old.Font="PRST"
old.Size=0.075
old.LineSpacing=1.0
end
That's it folks!