Welcome Guest 

Show/Hide Header

Welcome Guest, posting in this forum requires registration.





Pages: [1]
Author Topic: select files based on the currently selected file
inonio
Newbie
Posts: 10
Permalink
Post select files based on the currently selected file
on: July 19, 2019, 15:04
Quote

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.

2MR2
Administrator
Posts: 1194
Permalink
Post Re: select files based on the currently selected file
on: July 19, 2019, 16:34
Quote

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 🙂

inonio
Newbie
Posts: 10
Permalink
Post Re: select files based on the currently selected file
on: July 19, 2019, 16:48
Quote

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?

2MR2
Administrator
Posts: 1194
Permalink
Post Re: select files based on the currently selected file
on: July 19, 2019, 18:02
Quote

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.

2MR2
Administrator
Posts: 1194
Permalink
Post Re: select files based on the currently selected file
on: July 19, 2019, 18:19
Quote

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.

inonio
Newbie
Posts: 10
Permalink
Post Re: select files based on the currently selected file
on: July 19, 2019, 19:20
Quote

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

2MR2
Administrator
Posts: 1194
Permalink
Post Re: select files based on the currently selected file
on: July 19, 2019, 20:40
Quote

Ok I'll put it in v4.8

2MR2
Administrator
Posts: 1194
Permalink
Post Re: select files based on the currently selected file
on: July 19, 2019, 20:40
Quote

Ok I'll put it in v4.8

inonio
Newbie
Posts: 10
Permalink
Post Re: select files based on the currently selected file
on: July 19, 2019, 21:29
Quote

Great, thanks!

Pages: [1]
Mingle Forum by cartpauj
Version: 1.0.34 ; Page loaded in: 0.078 seconds.