The problem is acting upon the parent folder.
You can’t select the parent folder from inside with a PLE preset. Well, you can, but not directly. And if you string together the actions (first select the parent folder, then toggle it), you are met with the usual “commands running faster than cubase can handle them” and the macro of two PLEs works all the time only 60% of the time.
To explain further.
What’s the goal? We have a folder that contains tracks. We need to devise a method, so that with one button press we toggle the folder, no matter if we have the folder track selected or any of the tracks contained within.
One PLE preset won’t do. This is why:
(If container is folder AND
Property Is Set Is Selected) OR
(If container is track AND
Property Is Set Is Selected AND
Property is set Parent object Is Not selected)
Folder Toggle
Transform
This won’t work, because the folder will toggle alright, it’s a valid target. But the tracks contained within, while they ARE caught in the filter condition, they are not folders, so they can’t toggle. They should first trigger a selection of the parent folder, if this was to work.
Instead, we can use two presets. One to select the parent folder when we have any tracks selected, and then another one to toggle the selected folder.
But as I said at the beginning of this post, selecting the parent folder Directly is not possible, since there’s no “Parent folder” as an action target. We can do it indirectly by abusing visibility agents in the pre and post PLE slots, but it doesn’t work reliably, even with a handful of tracks.
Personally, I would make PLE presets that toggle folders by name, or color. One button for toggle Woodwind, one for Brass, one for Percussion, one for Keyboards/Plucked, one for Strings. 5 in all, and they would work always.