-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathexpression_reset_positioning.lua
28 lines (25 loc) · 1.13 KB
/
expression_reset_positioning.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
function plugindef()
finaleplugin.Author = "Robert Patterson"
finaleplugin.Copyright = "CC0 https://creativecommons.org/publicdomain/zero/1.0/"
finaleplugin.Version = "1.1.1"
finaleplugin.Date = "March 20, 2021"
finaleplugin.CategoryTags = "Expression"
finaleplugin.RequireSelection = true
return "Reset Expression Positions", "Reset Expression Positions", "Resets the assignment position of all selected single-staff expressions."
end
local library = require("library.general_library")
local expression = require("library.expression")
function expression_reset_positioning()
local current_part = library.get_current_part()
local expressions = finale.FCExpressions()
expressions:LoadAllForRegion(finenv.Region())
for exp_assign in each(expressions) do
if 0 == exp_assign.StaffListID then -- note: IsSingleStaffAssigned() appears to be not 100% accurate for exps with staff lists
if expression.is_for_current_part(exp_assign, current_part) then
exp_assign:ResetPos()
exp_assign:Save()
end
end
end
end
expression_reset_positioning()