<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-15">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Jari,<br>
<br>
when loading top/bottom text expressions from score lists<br>
with FCExpressions:LoadAllInCellLayout, the FCExpression.Staff<br>
returns a -1 value and FCExpression:CalcMetricPos() doesn't work.<br>
<br>
It will work though, if the staff number is assigned manually.<br>
See script below. Is this a bug or on purpose ?<br>
<br>
Jan<br>
<br>
<br>
local region=finenv.Region()<br>
local expressions=finale.FCExpressions() <br>
local staffsystemslookup=finale.FCStaffSystemsLookup ()<br>
local staffsystems = staffsystemslookup:GetCurrentPartStaffSystems
()<br>
for i,j in eachcell(region) do<br>
local cell=finale.FCCell(i,j)<br>
expressions:LoadAllInCellLayout(cell ,staffsystems)<br>
<br>
for e in each(expressions) do <br>
local point=finale.FCPoint(1,1)<br>
e:CalcMetricPos(point)<br>
print(e.Staff,point.X,point.Y) --prints -1, 1, 1 for top
expresssions<br>
<br>
--now temporarily assign top staff number and redo the
same<br>
if e.Staff==-1 then --if it's a top/bottom expression<br>
e.Staff=staffsystems:FindMeasureNumber(e.Measure).TopStaff --assign
top staff ID<br>
e:CalcMetricPos(point)<br>
print("Corrected:",e.Staff,point.X,point.Y) --prints
correct results<br>
end<br>
end<br>
end<br>
</body>
</html>