e.c Posted August 27, 2019 Share Posted August 27, 2019 (edited) I'm trying to incorporate Alfred in my workflow but something I am having trouble with is combining file search with tags and filenames. Spotlight seems to have no issue with this so it feels like Alfred should be able to do it too but I can't figure it out. Anyway, here is a typical situation I am interested in solving: I have a handful of files tagged `projectname`. Some of these files have the word `receipt` in the filename (e.g., `hotel receipt.pdf`). I would like to be able to open Alfred and type `tags projectname receipt` or even just `projectname receipt` and have it show me files tagged `projectname` with `receipt` in its name. Is this possible? Edited August 27, 2019 by Eric C Link to comment
deanishe Posted August 29, 2019 Share Posted August 29, 2019 On 8/27/2019 at 12:09 PM, Eric C said: Is this possible? I don't think it is, no. Perhaps @Vero can confirm. Alfred won't let you match across multiple fields (unlike Spotlight). So if you enter projectname receipt, Alfred will only show items where both words are in the tags or both are in the title. It won't show results where one word matches tags and one matches the title. Link to comment
Vero Posted August 29, 2019 Share Posted August 29, 2019 @Eric C Alfred constructs more specific, more accurate queries than Spotlight, but the drawback is that it's not possible to match different values across multiple fields in a single query. However, it's possible to create a workflow with multiple parts, where you first set the tag, then search within tagged items. Here's a workflow for you to play with, using the keyword "ftag": https://www.dropbox.com/s/uggoywmzxj6pllb/tag file search.alfredworkflow?dl=0 Type the name of your tag, hit return then type the name of the file. Cheers, Vero Link to comment
Andrew Posted September 6, 2019 Share Posted September 6, 2019 @Eric C if you update to the 4.0.4 b1108 pre-release, I've made a tweak to allow * as the Metadata Field allowing you to do the broad style of matching across multiple metadata fields as you described. Configure the file filter as follows, then you'll be able to type the file name and tags e.g. `projectname receipt`. Let me know how you get on. I have plans on improving this further in the future Cheers, Andrew Jasondm007 and GuiB 2 Link to comment
Jasondm007 Posted September 10, 2019 Share Posted September 10, 2019 @Andrew Thanks for making this update! It's super helpful!! Quick Question: Is it searching all available metadata fields or just the usual nine fields listed in Alfred's dropdown? Thanks! As for the improvements you alluded to above, is there any way this will include the ability to limit/specify the metadata fields? 😀🤞 Alfred rocks! Thanks again, @Andrew! Link to comment
Andrew Posted September 10, 2019 Share Posted September 10, 2019 1 hour ago, Jasondm007 said: Quick Question: Is it searching all available metadata fields or just the usual nine fields listed in Alfred's dropdown? You can put any metadata field in that table, and some may give worse performance than others, just experiment. If you want multiple fields, just add them all manually. Cheers! rob213 1 Link to comment
Jasondm007 Posted September 10, 2019 Share Posted September 10, 2019 1 hour ago, Andrew said: You can put any metadata field in that table, and some may give worse performance than others, just experiment. If you want multiple fields, just add them all manually. Cheers! My apologies @Andrew, I should have been a little more clear. I was asking whether the fantastic new * method for finding matches across multiple fields - as you've shown in the screenshot above, with the metadata field set to * - is limited to searching the nine default fields provided in the file filter or whether Alfred's actually searching all metadata fields on our system (e.g., kMDItemTextContent, kMDItemFSName, and all else)? Thanks again! Link to comment
Andrew Posted September 11, 2019 Share Posted September 11, 2019 @Jasondm007 Ah I see what you mean, actually I don't have control over this as it's just allowing you to pass * as the field in the constructed MDQuery. Also, in my experience, using fields prefixed with kMDItemFS can be quite a bit slower. Jasondm007 and rob213 2 Link to comment
Jasondm007 Posted September 11, 2019 Share Posted September 11, 2019 Got it, @Andrew!! Thanks again! Link to comment
johnyull Posted September 16, 2019 Share Posted September 16, 2019 Andrew/Vero, Great workflows. But in Andrews I can only search by tag then File name. Is there any way I can perform search w/ tag then content too (kMDItemTextContent) and even file extension/type. Link to comment
rob213 Posted January 13 Share Posted January 13 Hello @Vero and @Andrew, thank you for a very useful workflow. How would I modify the workflow so that once I type in the keyword and tag followed by return, all the pertinent files are automatically listed without having to type * followed by Enter. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now