[JW Lua] Expression Categories

Charles O. Lawrence charlesolawrence at bellsouth.net
Fri Oct 25 19:10:19 CEST 2013


A reboot solved the problem.  I thought that something I had done
experimenting with FCExpression or FCExpressionDef may have munged it up,
but I retried my test scripts after a reboot and do not see the problem
anymore.

By the way, running this test script causes the text expression on measure 3
to change to the music font, not a text font.  I'm not sure if this is the
proper way to go about it, but I was trying to change the existing tempo
mark text expression font in that measure to the default text font for the
category, Tempo Marks.  So I guess I don't get what Font0 is all about.
Also  I wanted to change the text from "A" to "B", represented by the last
of the enigma strings in the collection, so I was thinking I could trigger
on the text not being an enigma command since it didn't start with a ^, but
the IsEnigmaCommand property always returned true no matter what.  I guess I
don't get that either.

Charles

local expressions = finale.FCExpressions()
-- Load all elements for measure 3
expressions:LoadAllForItem(3)
print ("expressions Count",expressions.Count)

for e in each(expressions) do

    textExpDef = e:CreateTextExpressionDef()
    textString = textExpDef:CreateTextString()
    print (">>"..textString.LuaString.."<<")

    local enigmaStrings = textString:CreateEnigmaStrings(true)

    for enigmaString in each(enigmaStrings) do
         print("enigmaString",">>"..enigmaString.LuaString.."<<")
         if enigmaString:StartsWith("^fontTxt(") then
             enigmaString.LuaString = "^fontTxt(Font0,0)" -- supposedly the
default category Text font
         end
         if not enigmaString.IsEnigmaCommand then
            print ("Not a command >>"..enigmaString.LuaString.."<<")
            enigmaString.LuaString = "Extra Fast"
            end
     end	

-- Recreate the raw string based on the collection components

     textString = enigmaStrings:CreateString(nil)
     print(textString.LuaString)
     textExpDef:SaveTextString(textString)
     print("Save =",e:Save())

end






-----Original Message-----
From: JWLua [mailto:jwlua-bounces at jwmusic.nu] On Behalf Of Jari Williamsson
Sent: Thursday, October 24, 2013 4:07 PM
To: The JW Lua script plug-in.
Subject: Re: [JW Lua] Expression Categories

On 2013-10-24 17:54, Charles O. Lawrence wrote:
> I don't know if this is a question for this list or for the MakeMusic 
> forum, but I cannot seem to get the Category Designer dialog box to 
> accept any style modifications (Bold, Italics, Underline) to a 
> category like Tempo Marks using the buttons in the Text Font tab.  The 
> preview changes while you hold the button down, but reverts back as soon
as you release the button.
> The font and size can be modified.  Am I missing something?

Probably a question for MM tech support. Just guessing, but to me it sounds
like some kind of system conflict with the graphical control Finale is using
for that input.


Best regards,

Jari Williamsson



_______________________________________________
JWLua mailing list
JWLua at jwmusic.nu
http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu





More information about the JWLua mailing list