User Root Folder

Would be neat, that in the options we would have a section where we set “user root” folders.
Whenever we are in that folder’s path, using the Home button would send us to that folder.

Right now I’m in: C:\users\(me)\music\samples\drums\oneshots\kicks\waprod

So when I push the Home button it sends me to C:\. But I would want it to go to the samples folder instead. Anytime I’m in the samples that’s where I would want to go as the root.

We could also do other neat things with that. I could right click the folder I’m in and “open root path”. It would open all the folders, starting at the user root, in new tabs.

So in my example it would open six new tabs, one of each for: samples, drums, kicks, oneshots, kicks, waprod.

You can do that using a button that runs different commands depending on which path you're in.

See @ifpath and @ifpathr in Command modifier reference [Directory Opus Manual]

I didn't see @Leo's post as I was deep in thought.

I had a different idea using evaluator.
It is a little rough around the edges and doesn't do any path validity checking yet, but I have it working. As it is written now, this will open new tabs up to the drive letter.
Maybe with a little modification we can define some top levels to check for.

s = source ;
arr1 = Explode( s, "\" );
for (a = 0; a < 10; a++) 
    {
    arr2 = arr1;
	ArrayPop(arr2);
	If( Len(arr2) == 1 )
	     {
		 tab= Arrayget(arr2 , 0) + "\" ;		 
		 Run( "Go Newtab", ,tab);
		 Break;
		 }
    Else
	    {
	    tab = Implode(arr2, "\");
		Run( "Go Newtab", ,tab);
       	arr1 = arr2;
	    }	
    }

This sets a maximum of 10 tabs.
The button needs to set to Evaluator Function .

2 Likes

That’s cool, thanks guys.

Think I’m overengineering my idea, but it would be neat to have user root folders. You could add “userroot” as a function, so whenever you make a command, it will look in the parent folders to look for a user root folder, and if found, that will be the target for the command. A type of dynamic “ifpath”. “Find user root. That’s your path. Execute function based on this path.”

You could have a keyboard syntax character that means user root. When you do an inline search, put in that character then the query; it will search that section, starting at that folder. Don’t know if there are any spare keys. If it’s the plus sign, + for example, we could set up aliases for the roots. I type +S and that is telling Dopus “Starting at the samples folder”. +M music folder. Dunno, just had this idea.

But much of what you could do with that I’m sure you can already do with other things anyway.

Interesting idea.
You got me to think about it.

I started with the tabs part of the idea and have been working on that.
I still don't have the root folder idea worked in, but I did clean up my Evaluator button some.
It now checks for path validity.

It still opens tabs up to the drive letter though.
I'm thinking on how to introduce these root folders.
Aliases with similar names may be one possibility.

In any case here is a better version of the button.

s = source ;
If( PathType( s ) != "filesys" || Root( s ) == s )
    {
	Output("Done");	
    Return();
	}
arr = Explode( s, "\" );
for (a = 0; a < 10; a++) 
    {
	ArrayPop(arr);
	If( Len(arr) == 1 )
	     {
		 tab= Arrayget(arr , 0) + "\" ;		 
		 Run( "Go Newtab", ,tab);
		 Break;
		 }
    Else
	    {
	    tab = Implode(arr, "\");
		Run( "Go Newtab", ,tab);
        }	
    }

The button has to be set as an Evaluator Function .

Tabs.dcf (1.3 KB)
Or just use this one.

1 Like

Cool! :grinning_face:

I tested it, just going C:\user. I was already in user so it opened up the C:\ folder.
I’m afraid to test it in libraries; it will probably open every folder starting at C:\

I have already tested that.
The PathType( s ) != "filesys" line prevents that from happening.
It only works for a normal filesystem path unless we change that.

1 Like

Oh damn that actually works. I sat there watching my tabs open up one by one.

Hello all my little ones assembled before me. :grinning_face: Did you clean your room?

:boy::boy::boy::boy::boy::boy::boy::boy::boy::boy::boy::boy::girl:

Yes Father.

Ok good. So since processing these large tedious sample packs is making me weird, help me finish them quickly before I completely lose it.

Free fall through our midnight
This epilogue of our own fable

Heedless in our slumber
Floating nescient we free fall through this boundlessness
This madness of our own making

Yeah, I think this is how to find our top tab.
This can be done in part with the Evaluator Resolve() function.
I looked into this a little today.

It isn't that hard, it's really a matter of doing things right.
That takes real thinking.

1 Like

Ya, well I’m thinking of all the possibilities with user roots built in.

I have a “New” folder for each different type of library. I can plop new things there to be easily found later for processing.
So if I’m in doing video things I can right click, “send to root new” (or on a button etc.). Or copy to. Or send to root archive folder. There’s lots of overlap with pics, vids, docs, audio. They all have the same structure, and the same hotkey could just find the root and the explicit paths for those folders could already be set up.

Or search similar in root (will search for x property in all the root, but only the root). I have a video selected that has tags on it, I want to find = ur (user root) tags:similar. No matter what level of folder I’m in, it will recursively search starting at the users/video path for those tags.

Or add selection to file collection root. We could link up a file collection folder with a root. So if I’m in my pictures I can send = pics collection folder. It will see I’m in the pics branch, then send the file to the collections folder I set up in the options. If I’m in the videos it will send that file to the videos file collection folder instead.

Or duplicates search, or mirror actions etc. One click: find selected duplicates in user root. Or find all files with same date created or modified in user root.

The Home button could be set up to send us to that user root. Middle mouse button to open in new tab.

There’s probably a bunch more possibilities. We could already do all this manually, one for each library type, but the user root would let us have one hotkey piggybacking each action (combination “ifpath” hotkeys), and will test where we are to choose what it does.

Nah, I don’t think I’ve had a proper thought in my mind in years. :sweat_smile:

It’s who you know, amiright.
For we are not of those who despair without hope. :latin_cross:

Too much Canadian weed ? :beer_mug:
My driver's license requires random federal drug tests.

I think I may have it working here !
Set up the aliases for your root folders so that the first character is a "+".

s = source;
top_alias = "";
If( PathType( s ) != "filesys" || Root( s ) == s )
    {
	Output("Done");	
    Return();
	}	
arr = Explode( s, "\" );

for (a = 0; a < 10; a++) 
    {
    alias_candidate_arr = ArrayCopy(arr,0,a);
	alias_candidate = Implode(alias_candidate_arr, "\");
	alias = Resolve( alias_candidate ,"aef");	
	If( alias != "false" && alias ~< "/+" )
	     {      
		 top_alias = Resolve(alias);
		 Output(top_alias);
		 break;
		 }
    }
	
for (a = 0; a < 10; a++) 
    {
	ArrayPop(arr);
	If( Len(arr) == 1 )
	     {
		 tab= Arrayget(arr , 0) + "\" ;		 
		 Run( "Go Newtab", ,tab);
		 Break;
		 }
    Else
	    {
	    tab = Implode(arr, "\");
		Run( "Go Newtab", ,tab);
		tab == top_alias ? break : continue ;
        }	
    }

Tabs2.dcf (2.1 KB)

Edit note: It had one little mistake.
It was possible to test the value of top_alias without it being initialized.
I fixed the code.

Nah, I can’t even do that any more. It’s just too strong.
Funny story, I heard that the best create intoxicated and edit sober. Ok so I went to the store and came out with a tube that had “Saturday Night Ghost Train” on the label.

Well, I remember doing drums and moving patterns around, and that’s about it. The next day this was on my computer. :sweat_smile: no idea
Back before AI came in and made me give up.

You want me to configure some aliases, then use them with your button?

1 Like