Need help with PLE script to fold the parent folder

I have it set up that a folder closes if selected with Shift+F.

I would like it so, that if any event within that folder (say, a midi part) is selected, this shortkey will also close the parent folder.
A workaround is assign a shortkey to collapse all visible folders, but i would like for it to be folder specific.

Is this possible? I’ve messed in the PLE and i came close but it’s not working as wanted, probably for lack of any programming chops.

Help greatly appreciated

please use tags, so people can know what version or product you’re asking about

Post a screenshot of something you tried in a ple preset. I don’t precisely understand the question, particularly the part about closing the the containing folder of the selected midi part’s containing folder?

There was i thinking i explained it well, sorry about that : )

This is how it works now if i have a folder track selected:

I would it like that in this situation:

in which the folder track BRASS is unselected (and something else is, in this case a midi part), a shortkey will collapse the BRASS folder anyway.

Is that possible?

I’m not sure that’s possible.

But here’s the logic of your PLE, which might be useful for understanding.

  1. Look at all container types
  2. if the Container is selected
    close the container

You say also. is that the correct idea, or are you just talking about the folder the midi part is in?

anyway
In the top pane you have to express the status or property of the object you want to operate on.

I’m not in front of Cubase at the moment so this is just the logic, not an actual Cubase PLE sequence – but something like

  1. Type is Folder and
  2. contains selected objects
    close folder

Actually that screen shot i uploaded is wrong, that was something i didn’t use. Confusing

The way you described it i indeed how i have it set up: https://i.imgur.com/rhg8Yw3.jpeg

You say also. is that the correct idea, or are you just talking about the folder the midi part is in?

Yeah just the folder the midi part is in. The word also was unnecessary.

I feel it should be something like this: https://i.imgur.com/ZP5xMUZ.jpeg but this doesn’t work.

Basically all i need is an overriding command for ‘close folder i am currently in’ but yeah probably not possible.
Thanks anyway for your help

Please upload your images directly to the forum

Forum Guide (New here? Read this.)

I do not understand what you are after.

If you want make a post saying what function you want without reference to any key commands, please do.

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.

1 Like

Excellent explanation and observation, thank you.

I have indeed seen others using name-based folder toggle, on steamdecks or tablets, and i guess with a detour now i really found out why.

1 Like