[JW Lua] More Page Text Fun
Dave Foster
fozder at me.com
Wed Oct 23 15:17:44 CEST 2013
Hi Jari and all,
Thanks for figuring this out - I can confirm that I'm happily creating text programatically and putting it all over the page! A couple of things I've found / wondered:
1) The mysterious Enigma tag ^nfx can be set to ^nfx(64) for Fixed Size (font size)
2) Following on from Charles' questions, is there a way to get a line break when setting the text? /n isn't working here. Eg:
local newText = finale.FCPageText()
local textObject = finale.FCString()
textObject:AppendLuaString("First Line\nSecond Line")
newText:SaveNewTextBlock(textObject)
newText:SaveNew(1)
understands the escape character (just showing "First LineSecond Line") but doesn't act on it.
3) Is there any way to get / set the wildcards eg Title, Subtitle etc from Window / Score Manager / File Info (formally File / Score Info pre 2012)?
4) Using the numbers instead of the constants, I've found that the enumerator in the docs for TEXT_VERTICAL_ALIGN is slightly off - it should be
TEXTVERTALIGN_TOP (= 0)
TEXTVERTALIGN_BOTTOM (= 1)
TEXTVERTALIGN_CENTER (= 2)
(not top, centre, bottom), which also makes it consistent with the horizontal (left, right, centre).
I think your solution to circumvent the Finale quirk with Right Pages sounds fine - as long as there is a way to check that the IndependentRightPage hasn't been set other than checking for 0 (it may have be set to 0)?!
Thanks also for the tip about deleting all objects from a collection.
Cheers,
Dave
> I've tracked down the problem with the alignment. In your code, after
> the line:
>
>> newText.HorizontalAlignment = finale.TEXTHORIZALIGN_CENTER
>
> add this line as well:
> newText.HorizontalAlignmentRightPage = finale.TEXTHORIZALIGN_CENTER
>
> Then it should behave in the same way as Finale.
>
> I'm not sure how to fix this in a good way. To me, this seems to be a
> subtle Finale bug (that the right-side positioning is used even when the
> check box isn't checked).
>
> I guess I'm forced to clone the behaviour of Finale's Frame Attributes
> dialog box: auto-copy the default positioning/alignment values to the
> right-side positioning values if the IndependentRightPage hasn't been set.
>
> In the meantime, use the temporary fix above.
More information about the JWLua
mailing list