Quick Sign In:  

Forum: General Discussion

Topic: Collapse all open folders script. - Page: 1

This part of topic is old and might contain outdated or incorrect information

A user asked me for a script that would collapse all open folders.

After some brainstorming and testing, here it is:

repeat_stop 'rsi_CollapseFolders' & browser_window 'folders' & browser_scroll 'bottom' & param_equal get_browsed_folder_tab 0 ? set '$BRPreviousLevel' 0 & repeat_start_instant 'rsi_CollapseFolders' 100ms & browser_window 'folders' & browser_scroll -1 & param_equal get_browsed_folder_tab 0 ? var_equal '$BRPreviousLevel' 0 ? browser_scroll 'top' ? repeat_stop 'rsi_CollapseFolders' : nothing : browser_folder & set '$BRPreviousLevel' 0 & browser_scroll 'top' ? repeat_stop 'rsi_CollapseFolders' : nothing : get_browsed_folder_tab & set '$BRPreviousLevel' & browser_scroll 'top' ? repeat_stop 'rsi_CollapseFolders' : nothing : set '$BRPreviousLevel' 1 & repeat_start_instant 'rsi_CollapseFolders' 100ms & browser_window 'folders' & browser_scroll -1 & param_equal get_browsed_folder_tab 0 ? var_equal '$BRPreviousLevel' 0 ? browser_scroll 'top' ? repeat_stop 'rsi_CollapseFolders' : nothing : browser_folder & set '$BRPreviousLevel' 0 & browser_scroll 'top' ? repeat_stop 'rsi_CollapseFolders' : nothing : get_browsed_folder_tab & set '$BRPreviousLevel' & browser_scroll 'top' ? repeat_stop 'rsi_CollapseFolders' : nothing


Just copy/paste the code above on a custom button.
Since the actions involved are browser related increasing the speed of the script (by lowering the time between repeats from 100ms to let's say 50ms) is not considered to be a good idea for slower machines.
IF (and only IF) your machine has enough power to handle it, then you can change the 2 repeat speeds to 50ms, but not lower than that.
If your open tree is not long enough, it should end quite quickly (1-2 secs)
If your tree is very big then it may take some more time to complete. On a "wild" case scenario I tried here, it finished in 6 seconds.



repeat_stop 'rsi_CollapseFolders' & browser_window 'folders' & browser_scroll 'bottom' & param_equal get_browsed_folder_tab 0 ? set '$BRPreviousLevel' 0 & repeat_start_instant 'rsi_CollapseFolders' 100ms & browser_window 'folders' & browser_scroll -1 & param_equal get_browsed_folder_tab 0 ? var_equal '$BRPreviousLevel' 0 ? browser_scroll 'top' ? repeat_stop 'rsi_CollapseFolders' : nothing : browser_folder & set '$BRPreviousLevel' 0 & browser_scroll 'top' ? repeat_stop 'rsi_CollapseFolders' : nothing : get_browsed_folder_tab & set '$BRPreviousLevel' & browser_scroll 'top' ? repeat_stop 'rsi_CollapseFolders' : nothing : set '$BRPreviousLevel' 1 & repeat_start_instant 'rsi_CollapseFolders' 100ms & browser_window 'folders' & browser_scroll -1 & param_equal get_browsed_folder_tab 0 ? var_equal '$BRPreviousLevel' 0 ? browser_scroll 'top' ? repeat_stop 'rsi_CollapseFolders' : nothing : browser_folder & set '$BRPreviousLevel' 0 & browser_scroll 'top' ? repeat_stop 'rsi_CollapseFolders' : nothing : get_browsed_folder_tab & set '$BRPreviousLevel' & browser_scroll 'top' ? repeat_stop 'rsi_CollapseFolders' : nothing


Edit 2017/07/25:
I added some fool proof bits on the code. It will now return to folders list and keep folding even if you click out of folders tree before the script ends.
Just copy/paste the updated "code box" above.

PS: The script requires at least build 3566 to work properly
 

Posted Thu 22 Jun 17 @ 5:53 pm
 Best Answer The script has been updated so that it will jump back to folders tree and keep folding, even if the user clicks out of folders tree before the script ends.

Posted Tue 25 Jul 17 @ 7:20 am[ selected best answer by PhantomDeejay on Tue 25 Jul 17 @ 2:24 pm ]
locodogPRO InfinityModeratorMember since 2013
Very cool 5*'s
 

Posted Thu 22 Jun 17 @ 10:11 pm
Works great but there is an issue with the copy/paste on the Mac side and its because of the red you used to highlight numbers.

When you copy it and then try to paste it on the Mac side the right click does nothing within VDJ as long as the red was copied......
 

Posted Fri 23 Jun 17 @ 4:20 am
Try to paste it on TextEdit first ?
 

Posted Fri 23 Jun 17 @ 6:13 am
I added a simple code snippet.
Does it work if you copy it from there ?
 

Posted Fri 23 Jun 17 @ 6:15 am
PachNPRO InfinityMember since 2009
This is always a great feature if you have to deal with treeviews.
Maybe something that could be natively implemented as a context option?
 

Posted Fri 23 Jun 17 @ 10:00 am
lincol2PRO InfinityMember since 2011
cool
 

Posted Fri 23 Jun 17 @ 4:40 pm
VDJ RonPRO InfinityMember since 2010
This script appears to set up a loop in the veffects menu in at least some vdj builds. It looks similar to the folders closing and requires a vdj restart to halt. Can anyone confirm my observation?
 

Posted Sat 22 Jul 17 @ 3:53 pm
Can you explain better than that ?
Actually can you provide step by step instructions on how to reproduce ?

 

Posted Sun 23 Jul 17 @ 12:17 am
VDJ RonPRO InfinityMember since 2010
I'll try to do a video for you..its weird, it's like the script is looking for folders to close in the veffects menu but there are none. I can click a veffect and it stops the "search". It might be Monday before I can provide further information, and the vdj8.2 build. All the veffects are just moving in their menu.

..and I put the script on the keyboard key "c" and it does collapse the target folders.
 

Posted Sun 23 Jul 17 @ 2:22 am
Would be better if they fixed the tree control so it would remember the hierarchy of the children with ability to collapse all etc. and remember the state. Currently if you select to collapse at an upper level the hierarchy is lost at lower levels. Normal tree controls behave in a way that remembers the collapse state of the child members.

I guess you could say your script is better than nothing though. Main thing I see (besides it should be an internal thing) is the goto last folder element is lost. I think it would be a whole more useful if it worked like a normal tree control remembering the state of the child elements though.
 

Posted Sun 23 Jul 17 @ 3:01 am
Im in the middle of a wedding and it works perfectly! Rons drunk again, lmao!!

No restart needed here!
 

Posted Sun 23 Jul 17 @ 3:43 am
VDJ RonPRO InfinityMember since 2010
A mistake Beatbreaker..I've seen it and can video it, although I don't understand what's happening.
 

Posted Sun 23 Jul 17 @ 3:49 am
The script uses BROWSER commands.
It should NOT mess with your effects, unless you click on an effect slot while the script is still running, which you are NOT supposed to do anyway...
As I said when I posted this script, press the button AND WAIT for the script to finish. On all occassions I used this script, it finished within 1-2 seconds....

PS: Even if you click on an effect slot, clicking back to folders tree should resume normal operation of the script...
 

Posted Sun 23 Jul 17 @ 11:13 am
VDJ RonPRO InfinityMember since 2010
My first YouTube video and there may be many more.

https://www.youtube.com/watch?v=z-dg41rATvE

You can see clearly that the script has an effect on my veffects slot.

I haven't got much time but I'll try it with the default skin since it might be a skin related problem.

 

Posted Sun 23 Jul 17 @ 12:56 pm
Ok just so I can try to recreate what you did,

I put the script on a custom button, next you hit the custom button when the focus was on the browser tree?? And then your fxs started going crazy??

 

Posted Sun 23 Jul 17 @ 1:33 pm
VDJ RonPRO InfinityMember since 2010
In the latter half of the video I do everything from the beginning and the steps can be seen.

This YouTube video stuff is new to me..but it wont take long to master.

I've now deleted the script since I don't trust it anymore.
 

Posted Sun 23 Jul 17 @ 1:45 pm
It would've helped if you'd actually talked through what you were doing during the video.

Considering how verbose you are on here, I was surprised you didn't have a single word to say during the entire five minutes!
 

Posted Sun 23 Jul 17 @ 2:28 pm
@bigron:
Are you absolutely sure you copy/paste the script exactly as it is ?
The script stops executing automatically.
I can see that it doesn't in your case, which means that somewhere there's an error on typing it, or modifications made to it that causes auto execution stop to fail
 

Posted Sun 23 Jul 17 @ 5:08 pm
Pretty easy to reproduce. Have the browser tree opened so it will take some time and start the script. Then click any drop down effects menu. The script stops executing on browser list and executes on the effects list. If you dismiss the drop down effects list, the script starts executing on browser list again. Using 2 deck default skin.

So in the case above since the drop now has focus it executes on that. If you click on an element in the automix list while script is executing the script will now start to execute on the automix list.
 

Posted Sun 23 Jul 17 @ 6:25 pm
43%