Section Preferences
Preferences functions: workaround for bogus or missing function that read global preferences.
Summary
| Return type | Function 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, string | GetPreferredFont(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.
| Parameter | Type | Default | Description |
|---|---|---|---|
| settingName | string | settingName | |
| multiple | boolean | false | If 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 = falseand the setting is found, nilifmultiple = falseand no setting is found.
- A table if
- 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
| Parameter | Type | Default | Description |
|---|---|---|---|
| object | string | 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
nilif not found - int: Face, or
nilif not found - int: Size, or
nilif not found - string: color in RGB format,
"000000"for now as it may be impossible to parse.