This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
jwlua:fullscripts [2013/09/03 08:24] jariw [Create Tacet] |
jwlua:fullscripts [2013/10/08 08:06] (current) jariw |
||
---|---|---|---|
Line 1: | Line 1: | ||
This page contains some longer scripts that are "feature complete" in terms of their interaction with the Finale user. For shorter script examples, please refer to the page with [[jwlua:quickscripts|quick scripts]]. | This page contains some longer scripts that are "feature complete" in terms of their interaction with the Finale user. For shorter script examples, please refer to the page with [[jwlua:quickscripts|quick scripts]]. | ||
+ | |||
+ | The [[jwlua:harpglisssample|Using JW Lua - Create Harp Gliss]] page also contains a full script that might be of interest. | ||
==== Locked Systems Per Page ==== | ==== Locked Systems Per Page ==== | ||
Line 91: | Line 93: | ||
==== Create Tacet ==== | ==== Create Tacet ==== | ||
- | This script creates a tacet for the selected region, regardless of if the section contains music or how the measures has been configured regarding multimeasure breaks. It requires that the Automatic Update for multimeasure rests is OFF for the file. Before the tacet , a user alert is displayed. The script also requires a selected region (JW Lua will automatically tell the user if a region isn't selected). | + | This script creates a tacet for the selected region, regardless of if the section contains music or how the measures has been configured regarding multimeasure breaks. It requires that the Automatic Update for multimeasure rests is OFF for the file. Before the tacet , a user alert is displayed. The script also requires a selected region (//JW Lua// will automatically tell the user if a region isn't selected). |
Specifying the multimeasure rest preference record 1 doesn't really matter here (any value would load the same preference data), but generally speaking for single-instance preference records, it's good practice to load preference record 1 anyway. | Specifying the multimeasure rest preference record 1 doesn't really matter here (any value would load the same preference data), but generally speaking for single-instance preference records, it's good practice to load preference record 1 anyway. | ||
Line 98: | Line 100: | ||
-- This function and the 'finaleplugin' namespace | -- This function and the 'finaleplugin' namespace | ||
-- are both reserved for the plug-in definition. | -- are both reserved for the plug-in definition. | ||
- | finaleplugin.Author = "Jari Williamsson" | ||
finaleplugin.RequireSelection = true | finaleplugin.RequireSelection = true | ||
finaleplugin.CategoryTags = "Layout, Measure, Rest" | finaleplugin.CategoryTags = "Layout, Measure, Rest" | ||
Line 120: | Line 121: | ||
end | end | ||
- | -- Delete all old mm rests from the part | + | local region = finenv.Region() |
+ | |||
+ | -- Delete all old mm rests from the region | ||
-- (In this case, it's safe to delete from the start, since no relocation of data records takes place.) | -- (In this case, it's safe to delete from the start, since no relocation of data records takes place.) | ||
local mmrests = finale.FCMultiMeasureRests() | local mmrests = finale.FCMultiMeasureRests() | ||
mmrests:LoadAll() | mmrests:LoadAll() | ||
for mm in each (mmrests) do | for mm in each (mmrests) do | ||
- | mm:DeleteData() | + | if region:IsMeasureIncluded(mm.StartMeasure) or region:IsMeasureIncluded(mm.EndMeasure) then |
+ | mm:DeleteData() | ||
+ | end | ||
end | end | ||
- | + | ||
- | local region = finenv.Region() | + | |
local mm = finale.FCMultiMeasureRest() | local mm = finale.FCMultiMeasureRest() | ||
mm.StartMeasure = region.StartMeasure | mm.StartMeasure = region.StartMeasure | ||
Line 143: | Line 147: | ||
mm.UseSymbolsLessThan = mmrestprefs.UseSymbolsLessThan | mm.UseSymbolsLessThan = mmrestprefs.UseSymbolsLessThan | ||
mm.Width = mmrestprefs.Width | mm.Width = mmrestprefs.Width | ||
- | -- Create a new mm rest for the whole region | + | mm:Save()</code> |
- | -- (it will be saved at the start measure position) | + | |
- | mm:Save() | + | |
- | </code> | + |