Set a status icon, if a subfolder contains a certain file type?

I suppose, it's not possible without any scripting. I would like to have an automatic status icon, if one of the subfolders in my photo folders contains any video file.

Sounds like you may have found a solution to a similar problem a while ago:

The script column here searches for any *.jpg file and would be easy to modify:

In another more recent thread, there's a script-column that looks for a particular directory. The previous one is probably more what you want, but I mention it for completeness, in case someone finds this thread looking for something similar:

I don't understand this kind of stuff. I have tried to search tbone's script for ".iso" to replace it, but no luck. I can't put together, what is need to make this work. Sorry.

This is one big weakness of Opus in my opinion. Not everyone is a programmer. I don't know, which parts are relevant, where to make which changes, et cetera. Sorry, i'm not that smart.

I can understand stuff, where it's explained step by step, what exactly to do. I don't even know, if thise are three different solutions, or all needed to achieve the goal, or which scripts to use. I will stick to looking into every sub folder the old way.

Edit. I more an more find my requests either to be not answered, or not taken seriously. I still struggle with highlighted buttons, which i don't want to be highlighted, distracting me from my work, or annoying pop up menues, where i almost never need them, or hearing, "learn to code". Often i don't even like to aks stuff, because of that. I find this forum to be frustrating sometimes. It's getting useless for me.

Assuming the solution you had in the first thread isn't suitable (I don't know, but it sounded like it was in the past?), have a look at the second thread.

"The script column here searches for any *.jpg file and would be easy to modify:"

The first line of that script is:

var wild = DOpus.FSUtil.NewWild("*.(jpg|jpeg)", "f");

Changing the *.(jpg|jpeg) there to match the extensions you want to look should be something you can do.

If you want, you can change the other mentions of "JPEG" in the script to something more suitable, but those just control the names of things (e.g. the name of the column).

The script is very short, and very simple. You can work it out. You don't need to know programming to do these edits. Just try.

That script was from 2014. I don't even use it anymore, but surely had some reason back then. I will try to find out to which script your line refers to. It is not a part of tbones first script in the first of the three references, as far i can tell. I will have a look into the other one, then the gitrepo one that deals with the columns.

It's the second thread linked in my post above. The one linked under this sentence:

"The script column here searches for any *.jpg file and would be easy to modify:"

Thanks. I'm still searching for the sentence, but all i find was "Perfecto! I assume that if I want to modify it to locate folders that don't contain .nfo files I would modify this line" so far.

scratching head

e/
Ok, found it now, and will give that a try.

Ok, that was partly a success. The only issue is, that the script doesn't look more than one level deeper into the folder structure. I made a test putting an MP4 into the first level of subfolders, where it indicates the presence of that video file. Can the script be modiefied to look one sub folder deeper? I could add that column and save it for all subfolders, but that wouldn't be as elegant, since in the top level i would end up having a useless column (all saying "no", naturally).

To make it look in folders recursively, find this line near the middle of the script:

	var dir = DOpus.FSUtil.ReadDir(scriptColData.item.realpath);

Change it to this, adding , "r" near the end of the line:

	var dir = DOpus.FSUtil.ReadDir(scriptColData.item.realpath, "r");

(That tells the FSUtil.ReadDir function to be recursive.)

Note that this will make it much slower, if you have deeply nested folders. You probably would not want this to be active all the time or at least not in all folders (e.g. C:\).

If you are using it to define status icons / labels, you'll probably want to avoid testing folders outside the area you need the icon to appear in. (Actually, that's not a bad idea even when it isn't recursive.)

If the label is global, you'll want to make it test the path first, before testing the script-column. Alternatively, if the label is part of a Folder Format, and you're only applying that format in the areas that need it, then you don't need to do anything extra. Ask if you need help with either of those.

Thanks Leo, that looks promising. The structure isn't very nested. I have my large photo folder, then there are the date folders, where i would add that column, and there are only a few sub folders below that, like "Outtakes" and "Original Files" (here i have my few video files), where the script would have to look into. I also would make a button to be able to toggle the column, because i only need every now an then.

I also had a few thoughts about building or modifiying my filter, which normally leaves out those few folders when i want to make backups of the photo folders. My recent case was, that i wanted to leave out those folders, unless there are some videos in them. maybe it would have been possible, using the filter logic, but because i was in the middle of some big copying action, i didn't find the time to play around with the filter system. But with this soulution i also can see, if i have to toggle off the filter to have the vids included.

I have just tried your new line, it does find all the videos so far (i still have to check for the different video formats my cams might use, beside MP4 and AVI. I think i might also have some MOV), and it take a minute or sow, which is fast enough for me to use it casually. It would be quite useful here, if there was something similar like the "fromchecks" function from the checkbox mode, to transfer the findings to some status icon, to make the markings permanent. But i can also sort the column and apply the status icons manually, which is, what i would do next. Thanks for your patience and help, and i think i might even have some more use cases for future variations of this script. I wish i could understand more of this department, but i feel a bit to old to get into programming or scripting. Anyway, cheers!

:beers:

The problem is, you want Opus to work in ways it wasn't made to work by default. Opus is flexible and its behaviour can be changed in a lot of ways, but someone has to do the work of changing it. Since we're not actually on your payroll, expecting people here to jump to attention every time you want something changed from the defaults is unreasonable.

We've suggested many times you learn scripting because often the change from the default behaviour you want can most easily, or only, be implemented via scripting. And again, since we aren't your employees, it's unreasonable to expect us to do all the work for you when from our point of view it just looks like you're being lazy. We all managed to learn how to write scripts. We weren't born with some racial memory of knowing how to program.

The way I see it you have three options:

  • Use Opus the way it was designed and stop trying to change how it behaves
  • Learn how to make the changes you want (and we're always here to help - but not to do it all for you)
  • Find another file manager that fulfills your needs better.

Either way, continuously complaining about how hard Opus is to use isn't going to get you anywhere. It's only hard because you want it to be. If you use it how it's designed you don't need to do a thing.

Sorry, but i guess, there are lots of users, who will never learn scripting, since this a very difficult thing to start with, if you are older. I don't have enough time, and the nerves to start from scratch, cause i have other occupations.

My complaints about annoying details are ignored. Like those highlighted buttons, when i just want to have the keyboard having the focus. Or get rid of that small file types list, that i never use. I suppose, that those things would be quite easy for you, as the principle programmer of Opus, to change, but you certainly have a very different point of view, knowing much more ways to solve the problem. There was maybe a half a dozen attempts from my side, to make things easier, and hence my frustration with those unsolved issues.

As for the suggestion to find another file manager, i think, you know very well that Opus is the best one out there by far. So, no chance here Jon. :slight_smile:

I only try to help to improve Opus for my ball park of user abilities, even though the ideas may seem silly to some advanced users. In Fact, using Opus for maybe 10 years now, i forgot about lots of details, i have used in the past, due to changes in my work flow, and therefore struggle to get the most out of those vast possibilities there are in this software. So, technically, i don't think i want it to be hard, but more comprehensible. And if possible, not by switching it to some "simple" mode. I think, it would pay to consider to make some things more easier to manage.

What highlighted buttons are you talking about? I found a thread from you in 2007 asking how to stop buttons being highlighted, and it was answered. Is it the same issue again? Part of the problem is you keep asking the same questions, years apart, and forgetting that the problems have already been solved.

No, that's not what i meant. I tried to find the topic, that i had posted quite recently (no longer than maybe three months ago), but i gave up. The search function is another thing i'm not so happy about :wink: . (just kidding)

Anyway, if i want to use one of my many keyboard combinations, i very often find Opus not reacting, because one of those accelerator keys in the top menu keeps blocking any action. Waiting for something to happen in that area.

If it was up to me, i would like to completely get rid of any accelerator keys stuff, because of this happening all the time. We had that topic another time, maybe last year, where it was about switching desktops, and i followed your advice to change Dexpots trigger key from Alt to Ctrl (only for desktop 1, where Opus runs, otherwise i kept Alt as the trigger key) which mitigated the issue. Nevertheless, and i really don't know why, it happens all the time. Maybe because of all the task changes, switching between windows an so on?

I even tried a trick, completely removing the accelerator's "&" from the first menu item, but it didn't work.
So, basically i was talking about tweaks, which would things make easier for keyboard users. I'd be happy already to have some hope, if we or i could disable the Alt key behavior (causing the highlighted state, obviously), or to have some two seconds time out. The other thing (see the link below) i was talking about is that small popup list of file types, which also causes extra attention every time i use the filter. I'd like that to be switched off. And of course i think, this should be only optional, because to some other users it would make a lot of sense, depending of what exactly they do. When i started using Opus in 2004 (i believe), i was an 98% mouse user with file managers. I read about people, who used it almost with the keyboard all the time, and i wondered how funny that was. But over time i started to use the keyboard more and more, and now i am at 2% mouse. It turned out for me to be faster, especially since the hotkey abilities were extended vastly.

That's why i try to promote my ideas as to how to make keyboard work more fluent, nagging about those reoccurring tiny obstacles (as i said, this is individual).