Hi again @florian, another request. This time a lot more involved.
In my latest version just below the [ParserScriptAlbum]=...
there's a load of settings like below:
#:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::#
# .:: U S E R O P T I O N S ::. #
#:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::#
RegexpReplace "\(*Original Mix\)*" "" # Replace "" to your liking, block this with # to keep the original setting
RegexpReplace "(?i)\s+f(ea)?t\.*\s+" " feat. " # 'ft. => feat.' 'Ft. => feat.' 'Feat. => feat.'
# Leave only one of these lines below uncommented with no # preceding the line for each option (e.g. DATE & YEAR)
# DATE OPTIONS (Defaults to YYYY-MM-DD, so leave this commented out for this output)
# Set "OPTION:DATE_in_DDMM_format" "Add # at the start of this line to turn off this option"
# Set "OPTION:DATE_in_MMDD_format" "Add # at the start of this line to turn off this option"
# GENRE RENAME OPTION ('Progressive House' => 'House Progressive', 'Electro House' => 'House Electro', etc.)
Set "OPTION:GENRE_RENAME" "Add # at the start of this line to turn off this option"
# etc, etc...
And in the code, I do if statements to control these settings.
I wondered if this could be an external file that could be read and a dialog pop up to show this as settings.
The JSON file could look like so with the title of the dialog as:
Beatport Settings for stevehero WS Script v6:
{
"Beatport Settings for stevehero WS Script v6": [{
"name": "DATE in DDMM format or MMDD format",
"tooltip": "DATE in DDMM format or MMDD format.\n\nWill go here :)",
"option": [{
"variable": "OPTION:DATE_in_DDMM_format",
"value": true
},
{
"variable": "OPTION:DATE_in_MMDD_format",
"value": false
}
]
},
{
"name": "Genre Rename (Progressive House => House Prog)",
"tooltip": "Genre Rename (Progressive House => House Prog) tooltip.\n\nWill go here :)",
"option": [{
"variable": "OPTION:GENRE_RENAME",
"value": true
}]
},
{
"name": "Add Padding to INITIALKEY",
"tooltip": "Add Padding to INITIALKEY tooltip.\n\nWill go here :)",
"option": [{
"variable": "OPTION:INITIALKEY_ADD_PADDING",
"value": true
}]
},
{
"name": "Add Padding to TOTALTRACKS",
"tooltip": "Add Padding to TOTALTRACKS tooltip.\n\nWill go here :)",
"option": [{
"variable": "OPTION:TOTALTRACKS_ADD_PADDING",
"value": true
}]
},
{
"name": "Add Padding to TRACK",
"tooltip": "Add Padding to TRACK tooltip.\n\nWill go here :)",
"option": [{
"variable": "OPTION:TRACK_ADD_PADDING",
"value": true
}]
},
{
"name": "Append TOTALTRACKS to TRACK",
"tooltip": "Append TOTALTRACKS to TRACK tooltip.\n\nWill go here :)",
"option": [{
"variable": "OPTION:TRACK_TOTALTRACKS_APPEND",
"value": true
}]
}
]
}
Then this JSON file will appear in the menu like so:
Clicking on this would make a dialog appear that will read the JSON file and show a dialog with checkboxes or radio buttons for each of the JSON objects.
The way I see this is, if the options
array is only one a checkbox appears, if more than one then radio buttons appear as you can only have one or the other.
I guess you could put in strings also.
Then in my scripts, I could call a New function named GetVar
to call the option
object to retrieve the boolean or string.
The huge benefit is:
- When users upgrade, these settings are kept intact
- One setting file can be used for multiple scripts without the need to find and replace code in multiple files
- Can be used for any future upgrades
- People not adept at coding can easily tweak the output very easily.