forked from finale-lua/lua-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
clef_change.lua
46 lines (43 loc) · 1.38 KB
/
clef_change.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
function plugindef()
finaleplugin.Author = "Jacob Winkler"
finaleplugin.Copyright = "2022"
finaleplugin.Version = "1.0.1"
finaleplugin.Date = "2022-08-30"
finaleplugin.RequireSelection = true
-- finale.MinJWLuaVersion = 0.63 -- https://robertgpatterson.com/-fininfo/-rgplua/rgplua.html
finaleplugin.AuthorEmail = "[email protected]"
finaleplugin.AdditionalMenuOptions = [[
Clef 2: Bass
Clef 3: Alto
Clef 4: Tenor
Clef 5: Tenor (Voice)
Clef 6: Percussion
]]
finaleplugin.AdditionalUndoText = [[
Clef 2: Bass
Clef 3: Alto
Clef 4: Tenor
Clef 5: Tenor (Voice)
Clef 6: Percussion
]]
finaleplugin.AdditionalDescriptions = [[
Changes the selected region to bass clef
Changes the selected region to alto clef
Changes the selected region to tenor clef
Changes the selected region to tenor voice (treble 8ba) clef
Changes the selected region to percussion clef
]]
finaleplugin.AdditionalPrefixes = [[
clef_type = "bass"
clef_type = "alto"
clef_type = "tenor"
clef_type = "tenor_voice"
clef_type = "percussion"
]]
return "Clef 1: Treble", "Clef 1: Treble", "Changes the selected region to treble clef"
end
clef_type = clef_type or "treble"
local clef = require("library.clef")
local region = finenv.Region()
region:SetCurrentSelection()
clef.clef_change(clef_type, region)