vamp07 Posted February 17 Share Posted February 17 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? Link to comment
Stephen_C Posted February 17 Share Posted February 17 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 Link to comment
vamp07 Posted February 18 Author Share Posted February 18 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? Link to comment
Stephen_C Posted February 18 Share Posted February 18 (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 by Stephen_C Additional idea Link to comment
vitor Posted February 18 Share Posted February 18 You can Quick Look directly from Alfred. You can even press the arrow keys to navigate through results while keeping Quick Look open. Link to comment
vamp07 Posted February 19 Author Share Posted February 19 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!!!! Link to comment
vamp07 Posted February 21 Author Share Posted February 21 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. Link to comment
Stephen_C Posted February 21 Share Posted February 21 Have you tried typing in word1 word2? Stephen Link to comment
vamp07 Posted February 21 Author Share Posted February 21 I just did and it works but it does not seem to work in a file filter workflow. Link to comment
vitor Posted February 21 Share Posted February 21 Try adding a kMDItemTextContent (Click the [+]) in the Fields tab. Link to comment
TomBenz Posted February 21 Share Posted February 21 @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? Link to comment
vamp07 Posted February 22 Author Share Posted February 22 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. Link to comment
vamp07 Posted February 22 Author Share Posted February 22 (edited) Oh... never mind. I did not have split turned on for content. Edited February 22 by vamp07 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