Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: $directory(path,n) (Read 1131 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

$directory(path,n)

$directory(path,n)
Extracts directory name from the file path; goes up by n levels.

Is there a way to go down n levels from the topmost path, opposite to this?

Re: $directory(path,n)

Reply #1
This is probably the cleanest way -

Code: [Select]
$directory(%path%,$sub($len(%path%),$len($replace(%path%,\,)),N))

^ Replace N with 1 for top most folder, 2 for next, etc.

From this reddit thread (where I posted a couple other ways), which was from the very end of this HA thread in 2010.

Note that if you have more than one monitored folder in Preferences > Media Library where they start on a different folder level from each other, the resulting folders will be mixed up together (in library viewers) ...

Re: $directory(path,n)

Reply #2
This is really interesting
It has been a great help to this curious little boy.
I guess I will have to try more things to get to the results I want
But it has been a great help, thank you