Welcome Guest

Pages: 1
select files based on the currently selected file
inonioPostJuly 19, 2019, 15:04
Newbie
Posts: 10
Registered:
June 1, 2019, 15:29
Normal topicselect files based on the currently selected file

I want to create an action that selects files in the list, similar to File -> Select Files -> ... but with my own logic.

For example, I would like to select all files that have the same Artist and Year as the currently selected file.

EDIT: My approach is for my action to set a varibable with true/false on all files, then use "Stop action and Filter files" where my filter is "variable 2 = 1".

I've tried:
1. Creating an an action with "All files" checked, but then I don't have a reference to my selected file
2. Running an "All files" action from a normal action (where I set a named variable with the value to look for), but then the action ignores the "All files" flag

Thanks.

2MR2PostJuly 19, 2019, 16:34
Avatar photo
Administrator
Posts: 2083
Registered:
August 23, 2012, 19:27
Normal topicRe: select files based on the currently selected file

This is doable but remember that an action only has access to files which are selected in the main window when first starting the action. If you want to apply your criteria to any loaded file you more than likely should select All Files in the Action Manager.

You can create filters in the main window which test the contents of a Variable. Even numbered Variables are treated as strings while odd numbered Variables are treated as numeric. Variable 2 more than likely won't work as it will be interpreted as a string by the filter. Let's switch to Variable 1 for the sake of the following description.

Create a filter Variable 1 is not to 0. Name and save the filter.

In your action use the Stop Action and Filter Files statement. In the first control choose Select Files. In the second choose Matching Filter. Use the drop down list on the filter name field to choose the filter you created.

That's it 🙂

inonioPostJuly 19, 2019, 16:48
Newbie
Posts: 10
Registered:
June 1, 2019, 15:29
Normal topicRe: select files based on the currently selected file

The issue I'm having is that I want to select from all loaded files based on the selected file, like "File -> Select Files...":
1. Select a file manually in the UI
2. Run an action
3. Action results in all open files with the same Artist and Year as the originally selected file being selected

If I'm marking the action as "all files", I won't be able to extract the data from the originally selected file, as all files get selected before the action runs.

If I'm not marking the action as "all files", it will only select the file that is already selected when I run the action, as that's the only file it operates on.

So if I understand you, theres' no way to run an "all files" action, and have access from the action to the metadata of the file that is selected when I call the action, therefore I cannot implement a functionality similar to "File -> Select Files..." but with my own logic. Correct?

2MR2PostJuly 19, 2019, 18:02
Avatar photo
Administrator
Posts: 2083
Registered:
August 23, 2012, 19:27
Normal topicRe: select files based on the currently selected file

Ahhh. Sorry I didn't get it. Nope there is no way. You need a way to identify which file(s) were selected prior to applying the 'select all'. Alternately you'd have to be able to specify a variable for the content side of a filter line. Unfortunately, neither method is currently possible.

2MR2PostJuly 19, 2019, 18:19
Avatar photo
Administrator
Posts: 2083
Registered:
August 23, 2012, 19:27
Normal topicRe: select files based on the currently selected file

Actually you can do it now... sort of.

If you wanted to filter on on files which have the same Artist and Year as a single file. You could do it by successively hiding files which do not meet the criteria.

You would use the context menu's Hide Files>With Different Column Data. Click in the Artist column first and then do it again from the year column. You would end up with a set of files which met your criteria. Any action then run would only have access to the selected files or all non hidden files.

inonioPostJuly 19, 2019, 19:20
Newbie
Posts: 10
Registered:
June 1, 2019, 15:29
Normal topicRe: select files based on the currently selected file

Thanks, but I actually need to use a calculated field.
Is there any way to allow a normal ("all files" is unchecked) action to "Run" (as an action statement) an "all files" action? Currently when I do that the "all files" flag is ignored.
Hopefully that's something you can change. This will allow a user to run an action on the selected file(s) to set variables, then use these variables in an "all files" action.

Thanks again

2MR2PostJuly 19, 2019, 20:40
Avatar photo
Administrator
Posts: 2083
Registered:
August 23, 2012, 19:27
Normal topicRe: select files based on the currently selected file

Ok I'll put it in v4.8

2MR2PostJuly 19, 2019, 20:40
Avatar photo
Administrator
Posts: 2083
Registered:
August 23, 2012, 19:27
Normal topicRe: select files based on the currently selected file

Ok I'll put it in v4.8

inonioPostJuly 19, 2019, 21:29
Newbie
Posts: 10
Registered:
June 1, 2019, 15:29
Normal topicRe: select files based on the currently selected file

Great, thanks!

Pages: 1
Mingle Forum by Cartpauj | Version: 1.1.0beta | Page loaded in: 0.033 seconds.