vamp07 Posted February 17, 2023 Posted February 17, 2023 Hi, before I go down the rabbit hole, is it possible to build a workflow that will search a given folder for files that contain a given Content? I know searching file names is easy but is file content even possible with Alfred?
Stephen_C Posted February 17, 2023 Posted February 17, 2023 Take a look at this Alfred help page about file search—in particular about the ability to use the in keyword to search inside the content of files. You can limit the scope of a file search as you wish: take a look at the help page on the File Filter Input. If you have problems setting up the workflow just post again and someone will help. Stephen
vamp07 Posted February 18, 2023 Author Posted February 18, 2023 That helped. Got it working but I think I need to scroll and see a preview of everything found. I was kind of looking to get the equivalent of a finder search where I can then scroll through the preview. Maybe I'm trying to do something that alfred is not really meant for?
Stephen_C Posted February 18, 2023 Posted February 18, 2023 (edited) You could add to the workflow an Automation Task set to Read File Contents (assuming we're talking about text files) linked to a Copy to Clipboard action and then browse using Alfred's clipboard viewer. I appreciate that's not exactly what you want but it may help to point the way to some workable solution for you. Edit: You could instead of the clipboard action add an Action in Alfred action, set Jump to… to Open with… and connect that to the Quicklook app. Edit 2: Ignore the last idea: it appears not to work: sorry. Stephen Edited February 18, 2023 by Stephen_C Additional idea
vitor Posted February 18, 2023 Posted February 18, 2023 You can Quick Look directly from Alfred. You can even press the arrow keys to navigate through results while keeping Quick Look open.
vamp07 Posted February 19, 2023 Author Posted February 19, 2023 20 hours ago, vitor said: You can Quick Look directly from Alfred. You can even press the arrow keys to navigate through results while keeping Quick Look open. That's what I was looking for. Thanks!!!!
vamp07 Posted February 21, 2023 Author Posted February 21, 2023 In Alfred can I search for files that contain both x AND Y? I'm looking through the help but if such a basic question has an answer I can't find it.
Stephen_C Posted February 21, 2023 Posted February 21, 2023 Have you tried typing in word1 word2? Stephen
vamp07 Posted February 21, 2023 Author Posted February 21, 2023 I just did and it works but it does not seem to work in a file filter workflow.
vitor Posted February 21, 2023 Posted February 21, 2023 Try adding a kMDItemTextContent (Click the [+]) in the Fields tab.
TomBenz Posted February 21, 2023 Posted February 21, 2023 @vitor I use this and can locate content within a folder. It works well. Is it possible to do the exact search while looking for file content? How can one achieve this?
vamp07 Posted February 22, 2023 Author Posted February 22, 2023 8 hours ago, vitor said: Try adding a kMDItemTextContent (Click the [+]) in the Fields tab. I already had it. The problem is that with file filter workflows, using two search words does not seem to work. I don't need to add in because it's already implied, I think.
vamp07 Posted February 22, 2023 Author Posted February 22, 2023 (edited) Oh... never mind. I did not have split turned on for content. Edited February 22, 2023 by vamp07
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