<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
>I'm amazed you've been able to do your elaborate plug-ins with
such a lack of information.<br>
Unfortunately I couldn't test the code before I sent you the
correction. At first sight I only noticed the SaveNew() missing.<br>
But indeed I have never added an articulation before, I have only
used "articulation clone" ("AddArticulations") in my plug-ins and
this only to already existing notes.<br>
And I think I have not even used
FCNoteEntryCell:AppendEntriesInLayer before, I have always used
FCNoteEntryLayer:InsertEntriesAfter.<br>
I remember having problems with AppendEntriesInLayer which I didn't
have with InsertEntriesAfter. Maybe it was the reload? I don't know.<br>
<br>
Your original script was nearly ok (I mean the one that you sent me
via PM, it was different than the one on the list). <br>
It only needed the SaveNew() and, as Chris pointed out, the reload.<br>
<br>
Here is your corrected original script - slightly differen than
Chris' which is more optimized.<br>
For example entry.ArticulationFlag=true is not necessary (but indeed
faster) if you use notecell:Save() as you did in your script.<br>
<br>
function plugindef()<br>
-- This function and the 'finaleplugin' namespace<br>
-- are both reserved for the plug-in definition.<br>
return "Fermatas", "", ""<br>
end<br>
local fermatadef = finale.FCArticulationDef()<br>
local metatools = finale.FCMetatoolAssignments()<br>
metatools:SetMode(2)<br>
metatools:LoadAll()<br>
for metatool in each(metatools) do<br>
if metatool.Keystroke == 70 then<br>
fermatadef:Load(metatool:GetDefID())<br>
break<br>
end<br>
end<br>
<br>
for m, s in eachcell(finenv.Region()) do<br>
local cell = finale.FCCell(m, s)<br>
notecell = finale.FCNoteEntryCell(m, s)<br>
notecell:Load()<br>
if notecell:IsEmpty() then<br>
entry = notecell:AppendEntriesInLayer(1, 1)<br>
if entry then<br>
entry.Duration = finale.WHOLE_NOTE<br>
entry.Legality = true<br>
entry:MakeRest()<br>
<br>
notecell:Save() --this line added<br>
local index = notecell:GetIndexOf(entry) --this line
added<br>
notecell:Load() --this line added<br>
entry = notecell:GetItemAt(index) --this line added<br>
<br>
local fermata = finale.FCArticulation()<br>
fermata:SetArticulationDef(fermatadef)<br>
fermata:SetNoteEntry(entry)<br>
fermata:SaveNew() --this line changed<br>
notecell:Save()<br>
end<br>
end<br>
end<br>
<br>
<br>
Jan<br>
<br>
</body>
</html>