[JW Lua] FCSmartShape::SaveNewEverything

Thomas Weber thomas.weber at notengrafik.com
Wed Nov 18 17:28:29 CET 2015


Along the lines of my last post concerning "creating stuff": The documentation for FCSmartShape::SaveNewEverything says:


"For note-attached smart shapes, the frame collection that contains the entries need to be saved after the successful return from this method."


What does that actually mean?  Do I have to save the Cell/NoteEntryCell the entries supplied to FCSmartShape::SaveNewEverything?  I tried this without success:


local region = finenv.Region()
local cell = finale.FCCell(region.StartMeasure, region.StartStaff)
local nECell = cell:CreateNoteEntryCell(true, 0)
-- If the NoteEntryCell contains at least 2 notes, we can attach a hairpin
if nECell.Count > 1 then
    local hairpin = finale.FCSmartShape()
    if not hairpin:SaveNewEverything(nECell:GetItemAt(0), nECell:GetItemAt(1)) then
        error("Could not save new hairpin")
    end
    hairpin:SetHairpinFlags()
    hairpin.ShapeType = finale.SMARTSHAPE_CRESCENDO
    nECell:Save()
    cell:Save()
end


I guess I could write a Wiki page on how to create things once I learned about all this.




More information about the JWLua mailing list