finale-lua / lua-scripts

A central repository for all Lua scripts for Finale.
https://finalelua.com
Creative Commons Zero v1.0 Universal
15 stars 14 forks source link

Add measure_insert_and_shift_regions.lua #733

Closed asherber closed 4 months ago

asherber commented 5 months ago

This addresses something I often have to deal with: I set up a score with multiple measure number regions and start entering music, and at some point I find I need to insert or delete some measures. I then need to go through and make adjustments to the measure number regions.

It's currently biased towards the kinds of regions in the scores I make -- generally numeric ranges, with some lettered regions with numeric prefixes. I welcome suggestions for future improvements for other kinds of regions/adjustments.

From the Notes:

This script will insert or delete one or more measures; it will then adjust the start and end measures of the current and subsequent measure number regions.

It can also optionally:

For example, given three measure regions 1-5, 5A-5B, 6-10, if two measures are inserted into the first region and both optional adjustments are enabled, the regions will then look like 1-7, 7A-7B, 8-12.

The script will stop adjusting start numbers and numeric prefixes if it encounters a region with a numeric start number of 1 (indicating a new movement).

Note: At the moment, the script will only delete measures which sit within a single measure region.