Author: Sander
Script Version: 1
Minimum CoyoteMIDI Build: 820
// Ensure this script is ran from a translation.
enforcetrigger translation
// Get the tag from the translation parameter.
$tag = ($parameters tag)
// Get the target state from the translation parameter.
$state = ($parameters state)
// Convert On to True and Off to False for convenience.
if $state == On
$state = True
else if $state == Off
$state = False
// Switch based on whether the target control is a Translation, Modifier, or their respective folders.
switch ($parameters target)
// Handle setting the active states of translations.
case Translations
// Loop through every translation.
foreach $id : $translation in (gettranslations)
// If the translation's tag matches our target tag, we will change its active state.
if ($translation tag) == $tag
// If our target state is 'Toggle' we will grab the translation's current state and flip it.
$targetState = $state
if $state == Toggle
$targetState = !($translation active)
// Apply the desired active state to this translation.
translationactive $id $targetState
// Repeat the same logic for translation folders
case "Translation Folders"
foreach $id : $translationFolder in (gettranslationfolders)
if ($translationFolder tag) == $tag
$targetState = $state
if $state == Toggle
$targetState = !($translationFolder active)
translationfolderactive $id $targetState
// Repeat the same logic for modifiers
case "Modifiers"
foreach $id : $modifier in (getmodifiers)
if ($modifier tag) == $tag
$targetState = $state
if $state == Toggle
$targetState = !($modifier active)
modifieractive $id $targetState
// Repeat the same logic for modifier folders
case "Modifier Folders"
foreach $id : $modifierFolder in (getmodifierfolders)
if ($modifierFolder tag) == $tag
$targetState = $state
if $state == Toggle
$targetState = !($modifierFolder active)
modifierfolderactive $id $targetState
// Register the UI input fields shown in a translation when this script is selected.
event uirefreshed
translationparameter target (combobox "Target" "The type of control to toggle the active state of." (Translations, "Translation Folders", Modifiers, "Modifier folders") Translations 0.75)
translationparameter state (combobox "State" "The state to se the target control to." (Toggle, On, Off) Toggle 0.6)
translationparameter tag (textbox "Tag" "The tag of the control to target the active state of.")
3 downloads