[JW Lua] Read FileInfoText + Display the value of variable

Charles O. Lawrence charlesolawrence at bellsouth.net
Tue Nov 12 21:28:45 CET 2013


Jari,

You say the "^title()" Enigma command would never exist in File Info text.
This is confusing since the File Info includes a title among all the others.
When and where would a ^title() Enigma command ever exist.  When would you
use the various IsEnigmaFileInfo tests?

Thanks,
Charles



-----Original Message-----
From: JWLua [mailto:jwlua-bounces at jwmusic.nu] On Behalf Of Jari Williamsson
Sent: Tuesday, November 12, 2013 2:33 PM
To: The JW Lua script plug-in.
Subject: Re: [JW Lua] Read FileInfoText + Display the value of variable

Trying to answer both Bart and Charles in the same reply:

> local title_text = finale.FCFileInfoText()
> title_text:LoadTitle()
> local title = title_text:CreateString()
> print(title.LuaString)

Bart: These 4 lines are correct to get the File Info text for the "Title"
field and print it. In the case of File Info text, you might want to clean
the string with "title:TrimEnigmaTags()" as well, specially if you're saving
it back to Finale.

> local enigmaStrings = title:CreateEnigmaStrings(true)
> 	for enigmaString in each(enigmaStrings) do
>                       print(enigmaString.LuaString)
>                       print(enigmaString:IsEnigmaFileInfoTitle())
>                       if enigmaString:IsEnigmaFileInfoTitle() then
>                             print(enigmaString.LuaString)
>                       end
>                end	

Charles: FCString::IsEnigmaFileInfoTitle() would check if the substring is
the "^title()" Enigma command, which would never exist in File Info text.

Btw, if you use "print(myvar)" and you get the "UserData: 
0xsome_hex_number" output, you'll know it's a JW Lua class. In these cases,
use "print(myvar:ClassName())" to get the JW Lua class.


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