Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathexpression_remove_enclosure.lua
More file actions
Latest commit
37 lines (34 loc) · 1.63 KB
/
Copy pathexpression_remove_enclosure.lua
File metadata and controls
37 lines (34 loc) · 1.63 KB
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
29
30
31
32
33
34
35
36
37
functionplugindef()
finaleplugin.RequireSelection=true
finaleplugin.Author="Robert Patterson"
finaleplugin.Copyright="CC0 https://creativecommons.org/publicdomain/zero/1.0/"
finaleplugin.Version="1.1"
finaleplugin.Date="March 20, 2021"
finaleplugin.CategoryTags="Expression"
return"Expression Remove Enclosure", "Expression Remove Enclosure", "Removes any enclosure on any single-staff text expression in the currently selected region."
end
locallibrary=require("library.general_library")
localexpression=require("library.expression")
functionexpression_remove_enclosure()
localcurrent_part=library.get_current_part()
localexpression_assignments=finale.FCExpressions()
expression_assignments:LoadAllForRegion(finenv.Region())
forexpression_assignmentineach(expression_assignments) do
ifnotexpression_assignment:IsShape() andexpression_assignment:IsSingleStaffAssigned() then
ifexpression.is_for_current_part(expression_assignment, current_part) then
localexpression_def=finale.FCTextExpressionDef()
ifexpression_def:Load(expression_assignment.ID) then
ifexpression_def.UseEnclosurethen
localenclosure=expression_def:CreateEnclosure()
if (nil~=enclosure) then
enclosure:DeleteData()
end
expression_def:SetUseEnclosure(false)
expression_def:Save()
end
end
end
end
end
end
expression_remove_enclosure()