[JW Lua] Staff Baselines

Nick Mazuk nick at nickmazuk.com
Sun Sep 15 00:06:25 CEST 2019


Got a script working for adjusting the expression baselines above the staff. However, I’m running into two problems:

1. It seems to only work in Score View (not restricted from the Plugin Def)
2. The code does not seem to work with chords, fretboards, or lyrics

Here’s the working code:

local region = finenv.Region()
local start_measure = region:GetStartMeasure()

local systems = finale.FCStaffSystems()
systems:LoadAll()
local system = systems:FindMeasureNumber(start_measure)

local baselines = finale.FCBaselines()
baselines:LoadAllForSystem(finale.BASELINEMODE_EXPRESSIONABOVE, system:GetItemNo())

function ToEvpus(text)
    local str = finale.FCString()
    str.LuaString = text
    return str:GetMeasurement(finale.MEASUREMENTUNIT_DEFAULT)
end

for bl in each(baselines) do
    bl.VerticalOffset = bl.VerticalOffset + ToEvpus('1s')
    bl:Save()
end

The only change I made to the other versions are changing

baselines:LoadAllForSystem(finale.BASELINEMODE_EXPRESSIONABOVE, system:GetItemNo())

to

baselines:LoadAllForSystem(finale.BASELINEMODE_CHORD, system:GetItemNo())

From what I’ve read, this change should work, but it isn’t. Any ideas? I’ve spent a couple hours already trying things out.

Thanks,

Nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20190914/f27a85e5/attachment.html>


More information about the JWLua mailing list