Here's what I would like to do: I have saved a specific lister layout for working with certain kinds of files. When I am in this particular "working mode" and in the lister layout I have associated with it, I would like to color certain types of files in a certain way. As far as I understand, file and folder labels currently are applied as a global preference setting in Opus, and are not specific to a lister layout. So, to get around this limitation, my idea is to have the macro that switches to my specific working environment layout (using a simple Prefs LAYOUT="Some Layout" command) also turn on a specific set of labels. It looks like I could use something like "Properties SETLABEL=Green", say, to color selected files/folders, but in my case what I really want to do is create a wildcard label assignment (and later, when I switch back to other lister configurations, remove that wildcard assigment).
You can simply combine the Prefs LAYOUT and Properties SETLABEL commands. This example works for a dual pane layout and shows how you can also use regular Expressions with the Select command:
Prefs LAYOUT="My Layout"
Properties SETLABEL=blue FILE "*.ext1"
Properties SETLABEL=red FILE "*partofname*"
Properties SETLABEL=blue FILE "{destpath}*.ext1"
Properties SETLABEL=red FILE "{destpath}*partofname*"
Select REGEXP ^[0-9]{2}\s.*\.ext2 DESELECTNOMATCH
Properties SETLABEL=green
Set FOCUS=Dest
dopusrt /cmd Select REGEXP ^[0-9]{2}\s.*\.ext2 DESELECTNOMATCH
dopusrt /cmd Properties SETLABEL=green
To clean up all Labels before switching to another Layout you can use this:
I checked that all of the colors are defined, but when I press that button the layout is switched, but no labels are applied. What am I doing wrong here?
The Properties SETLABEL command does not create a wildcard label assignment, unfortunately. It applies the specified label to either the currently selected files, or the files specified with the FILE argument. Specifying a wildcard pattern for the FILE argument as shown above will apply the label to any files in the current folder that match the wildcard, but it doesn't create a global wildcard assignment using that pattern.
Ahh, that's what I feared, so what I wanted can't be done right now. Not a huge deal, I'll just keep my labels the same across all layouts. That may be a good idea anyway. Thanks for the clarification!
The value for the SETLABEL argument is the name of the label to assign, not the characteristics of the label itself. Labels have to be pre-defined through Preferences - see gpsoft.com.au/help/opus10/Do ... abels1.htm for more information.
It would probably work if you created a label called "Blue,Bold" though
Fair enough Jon. The fact that the Advanced dialog allowed the combination to be created suggested that additive application of existing defined labels might be an option but on reflection, whilst Blue,Bold is a reasonable request things like Red,Blue would not make a lot of sense..
The command editor only knows how to create the right syntax; it isn't clever enough to understand the semantics of every command and argument, or to prevent you from combining arguments which don't work together.
So you can use the editor menus to build up a command that is in the right format but which doesn't make sense or do anything useful.