<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hello Jari<br>
<br>
<span class="hps">I can</span> <span class="hps">duplicate a</span>
staff <span class="hps">with</span> <span class="hps">SaveAs</span>(),
<span class="hps">creating</span> <span class="hps">TextBlocks</span>
<span class="hps">with</span> <span class="hps">methods</span> <span
class="hps atn">"</span><span>SaveNewFullNameString</span><span
class="atn">" and "</span><span>SaveNewAbbreviatedNameString</span><span>"</span><span>,</span>
<span class="hps">it works</span><span>.</span> <br>
<span class="hps">But</span> <span class="hps">when I create</span>
<span class="hps">a new staff, </span><span class="hps">the </span><span
class="hps"><span class="hps">methods "</span>SaveNew</span>" and
<span class="hps">"SaveAs"</span> <span class="hps"></span> <span
class="hps">return false.</span><br>
<br>
<br>
---------------------- DUPLICATE THE FIRST STAFF
------------------------------------------<br>
function firstFreeIndex()<br>
local staff = finale.FCStaff()<br>
local i = 0<br>
<br>
repeat<br>
i = i + 1<br>
until not staff:Load(i)<br>
<br>
return i<br>
end<br>
<br>
local staff = finale.FCStaff()<br>
if staff:Load(1) then<br>
local strName =finale.FCString()<br>
strName.LuaString="full name"<br>
staff:SaveNewFullNameString (strName)<br>
local strAbrev =finale.FCString()<br>
strAbrev.LuaString="abrev"<br>
staff:SaveNewAbbreviatedNameString (strAbrev)<br>
<br>
staff:SaveAs(firstFreeIndex())<br>
<br>
local st = finale.FCSystemStaff()<br>
st.Staff= staff.ItemNo<br>
st.Distance = 300<br>
st.Resize = 100<br>
st:SaveNew(0) -- Scroll View<br>
<br>
local staffsystems = finale.FCStaffSystems()<br>
staffsystems:LoadAll()<br>
<br>
for ss in each(staffsystems) do<br>
st:SaveNew(ss.ItemNo) <br>
end<br>
<br>
end<br>
<br>
<br>
<br>
-------------------------- CREATE A NEW STAFF
-----------------------------------------------<br>
<br>
local staff = finale.FCStaff()<br>
staff.AltNotationDisplayOtherLayerNotes = true<br>
staff.AltNotationLayer = 1<br>
staff.AltNotationStyle =finale.ALTSTAFF_NORMAL <br>
staff.FirstClef = 5<br>
staff.HideMode = 0<br>
staff.IgnoreKeySig = false<br>
staff.IndependentKeySig = false<br>
staff.IndependentTimeSig = false<br>
staff.InstrumentUUID = finale.FFUUID_CLASSICALGUITAR <br>
staff.LineCount = 5<br>
staff.NotationStyle = finale.STAFFNOTATION_NORMAL <br>
staff.ShowAugmentationDots = true<br>
staff.ShowBarlines = true<br>
staff.ShowChords = true<br>
staff.ShowClefs = true<br>
staff.ShowFretboards = true<br>
staff.ShowKeySignatures = true<br>
staff.ShowLyrics = true<br>
staff.ShowMeasureNumbers = true<br>
staff.ShowPartStaffNames = true<br>
staff.ShowRepeats = true<br>
staff.ShowRests = true<br>
staff.ShowScoreStaffNames = true<br>
staff.ShowStaffLines = true<br>
staff.ShowStems = true<br>
staff.ShowTextRepeats = true<br>
staff.ShowTies = true<br>
staff.ShowTimeSignatures = true<br>
staff.TransposeAlteration = 0<br>
staff.TransposeChromatic = false<br>
staff.TransposeClefIndex = 0<br>
staff.TransposeInterval = 0<br>
staff.TransposeSimplifyKey = false<br>
staff.TransposeUseClef = false<br>
<br>
local strName =finale.FCString()<br>
strName.LuaString="full name"<br>
staff:SaveNewFullNameString (strName)<br>
local strAbrev =finale.FCString()<br>
strAbrev.LuaString="abrev"<br>
staff:SaveNewAbbreviatedNameString (strAbrev)<br>
<br>
print(staff:SaveNew())<br>
<br>
local st = finale.FCSystemStaff()<br>
st.Staff= staff.ItemNo<br>
st.Distance = 500<br>
st.Resize = 100<br>
st:SaveNew(0) -- Scroll View<br>
<br>
local staffsystems = finale.FCStaffSystems()<br>
staffsystems:LoadAll()<br>
for ss in each(staffsystems) do<br>
st:SaveNew(ss.ItemNo) <br>
end<br>
<br>
------------------------------------------------------------------------------------<br>
<br>
<font color="#0000ff"><font color="#000000">Thanking you in advance</font></font><br>
<br>
Chris<br>
<br>
<br>
<br>
</body>
</html>