[JW Lua] Help Adding Articulation

Jan Angermüller jan at angermueller.com
Sat Sep 29 09:16:41 CEST 2018


Instead of          fermata:Save()   use          fermata:SaveNew().
All new objects must be saved as SaveNew() in JW Lua.

Am 29.09.2018 um 02:42 schrieb Bryan Higgins:
> function plugindef()
>    -- This function and the 'finaleplugin' namespace
>    -- are both reserved for the plug-in definition.
>    return "Fermatas", "", ""
> end
> local fermatadef = finale.FCArticulationDef()
> local metatools = finale.FCMetatoolAssignments()
> metatools:SetMode(2)
> metatools:LoadAll()
> for metatool in each(metatools) do
>    if metatool.Keystroke == 70 then
>       fermatadef:Load(metatool:GetDefID())
>       break
>    end
> end
>
> for m, s in eachcell(finenv.Region()) do
>    local cell = finale.FCCell(m, s)
>    notecell = finale.FCNoteEntryCell(m, s)
>    notecell:Load()
>    if notecell:IsEmpty() then
>       entry = notecell:AppendEntriesInLayer(1, 1)
>       if entry then
>          entry.Duration = finale.WHOLE_NOTE
>          entry.Legality = true
>          entry:MakeRest()
>          local fermata = finale.FCArticulation()
>          fermata:SetArticulationDef(fermatadef)
>          fermata:SetNoteEntry(entry)
>          fermata:Save()
>          notecell:Save()
>       end
>    end
> end

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20180929/972e607f/attachment.htm>


More information about the JWLua mailing list