function plugindef()   -- This function and the 'finaleplugin' namespace   -- are both reserved for the plug-in definition.   finaleplugin.RequireScore = true   return "Set System to Page Height", "Set System to Page Height", "If there is only 1 system on a page, it makes that system\'s height the same height as a page"end

local systems = finale.FCStaffSystems()
systems:LoadAll()
for page in loadall(finale.FCPages()) do
    page:UpdateLayout()
    local system = page:CalcLastSystem()
    if system == page:GetFirstSystem() then --if there is only one system on the page (i.e. the first and last system are the same)
        local sys = systems:GetItemAt(system - 1)
        local sysheight = sys:CalcHeight(true)
        local pageheight = page:CalcInteriorHeight()
        if sysheight / pageheight > 0.6 then
            local resize = sys:GetResize()
            sysheight = sysheight + 60
            sys:SetResize(resize * pageheight / sysheight)
            sys:Save()
        end
    end
end