Section Preferences

Preferences functions: workaround for bogus or missing function that read global preferences.

Summary

Return typeFunction and summary
 GetGlobalSetting(string settingName, boolean multiple)
Reads a line from global settings file, when MyrScript has no built-in function to get the value of a global setting.
string, int, int, stringGetPreferredFont(string object)
Get preferred font from Global settings > Fonts

Functions

GetGlobalSetting(string settingName, boolean multiple)

Reads a line from global settings file, when MyrScript has no built-in function to get the value of a global setting.

ParameterTypeDefaultDescription
settingNamestring settingName
multiplebooleanfalseIf false, first line starting with settingName then return it, if true, return all lines that start with settingName in a table.
Return
  • A table if multiple = true,
  • A string if multiple = false and the setting is found,
  • nil if multiple = false and no setting is found.
Example


 local tab = GetGlobalSetting("tabPredefNuances", true)
 --> {"tabPredefNuances 0 20", "tabPredefNuances 1 40", ...}
 local ppp = GetGlobalSetting("tabPredefNuances 0") --> 20
 local pp = GetGlobalSetting("tabPredefNuances 1") --> 40

GetPreferredFont(string object)

Get preferred font from Global settings > Fonts

ParameterTypeDefaultDescription
objectstring One of the items in the global settings dialog in English: "Staff name", "Break text", "Tempo", "Rules names", "Effects & ornaments", "Tablature key", "Tablature grace note", "Tablature note", "Chord grid name", "Chord grid display", "Chord grid summary", "Key summary", "Karaoke line", "Ruler", "Help window", "Array", "Pop up menus"
Returns
string: Font name, or nil if not found
int: Face, or nil if not found
int: Size, or nil if not found
string: color in RGB format, "000000" for now as it may be impossible to parse.