Library

Functions

group_overlaps_region

library.group_overlaps_region(staff_group, region)

View source

Returns true if the input staff group overlaps with the input music region, otherwise false.

Input Type Description
staff_group FCGroup
region FCMusicRegion
Return type Description
boolean

group_is_contained_in_region

library.group_is_contained_in_region(staff_group, region)

View source

Returns true if the entire input staff group is contained within the input music region. If the start or end staff are not visible in the region, it returns false.

Input Type Description
staff_group FCGroup
region FCMusicRegion
Return type Description
boolean

staff_group_is_multistaff_instrument

library.staff_group_is_multistaff_instrument(staff_group)

View source

Returns true if the entire input staff group is a multistaff instrument.

Input Type Description
staff_group FCGroup
Return type Description
boolean

get_selected_region_or_whole_doc

library.get_selected_region_or_whole_doc()

View source

Returns a region that contains the selected region if there is a selection or the whole document if there isn’t. SIDE-EFFECT WARNING: If there is no selected region, this function also changes finenv.Region() to the whole document.

Return type Description
FCMusicRegion

get_first_cell_on_or_after_page

library.get_first_cell_on_or_after_page(page_num)

View source

Returns the first FCCell at the top of the input page. If the page is blank, it returns the first cell after the input page.

Input Type Description
page_num number
Return type Description
FCCell

get_top_left_visible_cell

library.get_top_left_visible_cell()

View source

Returns the topmost, leftmost visible FCCell on the screen, or the closest possible estimate of it.

Return type Description
FCCell

get_top_left_selected_or_visible_cell

library.get_top_left_selected_or_visible_cell()

View source

If there is a selection, returns the topmost, leftmost cell in the selected region. Otherwise returns the best estimate for the topmost, leftmost currently visible cell.

Return type Description
FCCell

is_default_measure_number_visible_on_cell

library.is_default_measure_number_visible_on_cell(meas_num_region, cell, staff_system, current_is_part)

View source

Returns true if measure numbers for the input region are visible on the input cell for the staff system.

Input Type Description
meas_num_region FCMeasureNumberRegion
cell FCCell
staff_system FCStaffSystem
current_is_part boolean true if the current view is a linked part, otherwise false
Return type Description
boolean

calc_parts_boolean_for_measure_number_region

library.calc_parts_boolean_for_measure_number_region(meas_num_region, for_part)

View source

Returns the correct boolean value to use when requesting information about a measure number region.

Input Type Description
meas_num_region FCMeasureNumberRegion
for_part (optional) boolean true if requesting values for a linked part, otherwise false. If omitted, this value is calculated.
Return type Description
boolean the value to pass to FCMeasureNumberRegion methods with a parts boolean

is_default_number_visible_and_left_aligned

library.is_default_number_visible_and_left_aligned(meas_num_region, cell, system, current_is_part, is_for_multimeasure_rest)

View source

Returns true if measure number for the input cell is visible and left-aligned.

Input Type Description
meas_num_region FCMeasureNumberRegion
cell FCCell
system FCStaffSystem
current_is_part boolean true if the current view is a linked part, otherwise false
is_for_multimeasure_rest boolean true if the current cell starts a multimeasure rest
Return type Description
boolean

update_layout

library.update_layout(from_page, unfreeze_measures)

View source

Updates the page layout.

Input Type Description
from_page (optional) number page to update from, defaults to 1
unfreeze_measures (optional) boolean defaults to false

get_current_part

library.get_current_part()

View source

Returns the currently selected part or score.

Return type Description
FCPart

get_score

library.get_score()

View source

Returns an FCPart instance that represents the score.

Return type Description
FCPart

get_page_format_prefs

library.get_page_format_prefs()

View source

Returns the default page format prefs for score or parts based on which is currently selected.

Return type Description
FCPageFormatPrefs

get_smufl_font_list

library.get_smufl_font_list()

View source

Returns table of installed SMuFL font names by searching the directory that contains the .json files for each font. The table is in the format:

<font-name> = "user" | "system"
Return type Description
table an table with SMuFL font names as keys and values “user” or “system”

get_smufl_metadata_file

library.get_smufl_metadata_file(font_info)

View source

Input Type Description
font_info (optional) FCFontInfo if non-nil, the font to search for; if nil, search for the Default Music Font
Return type Description
file handle|nil

is_font_smufl_font

library.is_font_smufl_font(font_info)

View source

Input Type Description
font_info (optional) FCFontInfo if non-nil, the font to check; if nil, check the Default Music Font
Return type Description
boolean

simple_input

library.simple_input(title, text, default)

View source

Creates a simple dialog box with a single ‘edit’ field for entering values into a script, similar to the old UserValueInput command. Will automatically resize the width to accomodate longer strings.

: string

Input Type Description
title (optional) string the title of the input dialog box
text (optional) string descriptive text above the edit field
default (optional) string optional text for default value of edit field

is_finale_object

library.is_finale_object(object)

View source

Attempts to determine if an object is a Finale object through ducktyping

Input Type Description
object __FCBase
Return type Description
bool

get_parent_class

library.get_parent_class(classname)

View source

Returns the name of the parent of a class.

Input Type Description
classname string
Return type Description
string | nil The parent classname or nil if the class has no parent (ie __FCBase).

get_class_name

library.get_class_name(object)

View source

Returns the real class name of a Finale object. Some classes in older JW/RGPLua versions have incorrect class names, so this function attempts to resolve them with ducktyping

Input Type Description
object __FCBase
Return type Description
string

system_indent_set_to_prefs

library.system_indent_set_to_prefs(system, page_format_prefs)

View source

Sets the system to match the indentation in the page preferences currently in effect. (For score or part.) The page preferences may be provided optionally to avoid loading them for each call.

Input Type Description
system FCStaffSystem
page_format_prefs (optional) FCPageFormatPrefs page format preferences to use, if supplied.
Return type Description
boolean true if the system was successfully updated.

calc_script_filepath

library.calc_script_filepath()

View source

Returns the full filepath of the running script.

Return type Description
string a string containing the filepath, encoded in UTF-8

calc_script_name

library.calc_script_name(include_extension)

View source

Returns the running script name, with or without extension.

Input Type Description
include_extension (optional) boolean Whether to include the file extension in the return value: false if omitted
Return type Description
string The name of the current running script.

get_default_music_font_name

library.get_default_music_font_name()

View source

Fetches the default music font from document options and processes the name into a usable format.

Return type Description
string The name of the defalt music font.