[JW Lua] New sample script: Align repeat brackets

Jari Williamsson jari.williamsson at mailbox.swipnet.se
Thu Oct 2 08:52:13 CEST 2014


On 2014-09-25 22:29, Gábor Orth wrote:

> If I would like to set the lenght of the horizontal line of the simple
> repeat bracket with the Lua, there is any solution for this?

To change the forward (ending) horizontal repeat lines in the region, do 
something like this. "-100" in the example would move the bracket handle 
100 EPVUs to the left of the right barline.

---
local region = finenv.Region()
if region:IsEmpty() then return end
for measure = region.StartMeasure, region.EndMeasure do
     local r = finale.FCEndingRepeat()
     if r:Load(measure) then
         r.HorizontalRightBracketPosition = -100
         r:Save()
     end
end
---


To instead change the backward horizontal repeat lines in the region, do 
something like this. "100" in the example would move the bracket handle 
100 EPVUs to the right of the left barline.

---
local region = finenv.Region()
if region:IsEmpty() then return end
for measure = region.StartMeasure, region.EndMeasure do
     local r = finale.FCBackwardRepeat()
     if r:Load(measure) then
         r.LeftBracketPosition = 100
         r:Save()
     end
end
---


Best regards,

Jari Williamsson






More information about the JWLua mailing list