Is there a code that can be put into a button; that can run a 'Select By Pattern' preset, and then after run a command on what has been selected?
For example: this desired button will find any file in the current folder that is missing a certain tag.
Then it will write some metadata to the files that it selected, then add the missing tag.
Currently I can do this with multiple steps. But I'm wondering if 'Select By Pattern' can be injected into a button, to run a preset as the first step in the sequence. To make this sequence of steps be one button click.
Would the pattern always be the name of the missing tag ?
1 Like
Yes. For sequences other than this particular one I can make new buttons for those and put them all in a drop down list if I want. I did that with my custom tag management:
Reading up on the select by pattern and I think that I can just use the simple select, without having to use an advanced preset. But my bad coding isn't working.
I'm not very used to filters, but Select SIMPLE
is described in the manual as the way to display the Select dialog in Simple mode.
It does take no parameter. That's why the rest of the line will be either ignored (and simply display the dialog) or will fail (not displaying anything).
If I understand correctly, this could work :
Select HIDEUNSEL FILTERDEF tags nomatch MyTagInsertedHere nowild
This will select all files not having the MyTagInsertedHere
(and hide all the others).
I added this HIDEUNSEL because in my tests, if a file with the tag is previously selected, then it is kept in the results.
1 Like
I changed it to this (removed the hiding) and it actually works!
Select FILTERDEF tags nomatch ASM nowild
(if anyone else needs this, ASM is my own tag, replace it with yours)
You're a life saver! Even with studying the 'Select Command' reference page, I would have never found the arguments that work.
This works beautifully. In one click I can process a folder of files. It will only add the metadata to whatever didn't have it before. (I guess it would have worked otherwise, because the same text probably would have wrote over the old text) but this is still useful for many things. And defining multiple 'Select By' patterns. I can also use this in another button to hide whatever is not selected, giving me that 'select group to-top' I want.
Here's the sequence:
Select FILTERDEF tags nomatch ASM nowild
SetAttr META "author:(me)"
SetAttr META "Copyright:(copyright info)"
SetAttr META tags:+ASM
Select NONE
The bracketed text is not what's on my button. Anyone using this enter in your own data in the fields, removing the brackets too.
If you ever need to search for files/folder matching different conditions (e.g. not just a tag) :
- Open the find panel in "Advanced Mode" but with "text editor" unchecked
- Enter your clauses, test them
- Once it's ok, check the "text editor" (upper right of the filter definition panel), and it will give you the text to feed to the end of the command (after
FILTERDEF
). If it's multilne, regroup everything on a single line.
2 Likes
Oh cool. That 'Edit as text' trick is handy.
This is giving me ideas.
Thinking of ways to use this and I've decided to piggyback the attributes rating system, converting it to a priority system. After another Black Friday sale fiasco, I have less than a quarter terabyte of space left so am being forced to make some hard decisions.
That, and I don't think a person judging their own craftsmanship is as good as other people judging it. So me rating my own files has little value. For example: on the Image Line forum there is a section to upload your created music and people will critique it. That is much better data then me thinking my song is awesome and giving it a five star rating on my own computer, patting myself on the back. So I think having the rating as a priority scale instead would be more beneficial, for me at least.
After other people have judged something then it's probably good to record that data, and the ratings column is valuable once again. Maybe I can have that as another column using different icons.
Testing it out in my Forums picture folder.
Made an evaluator column that is the 'Rating' type, and made 'Set Priority' and 'Filter Priority' buttons, right above where the column always is.
Used an evaluator column to change the header to "Priority" but now it's glitching out on me. Everything that's not a 1 star is a 5 star in the column. I will report that.
So the 'Filter By Priority' is where I'm applying these new commands.
I combined the select by pattern code and the hide code, so it will show only the files that are that selected priority. This is kind of like the filter bar but for ratings. And my 'Clear Filter' will show all files.