Jump to content

workflow: search inside files


Recommended Posts

Hi there,

 

i use alfred quite a lot and since i switched from windows half a year ago, but I never managed to get behind workflows. Related to my question in the support forums (http://www.alfredforum.com/topic/2472-is-there-a-way-to-search-inside-files/) I'd like to ask for some assitance in getting a workflow created.

 

What i want to do:

I recently scanned all / most of my documents into PDFs and saved them on my harddisk. Now I need a possibilty to quickly find keywords within that PDFs (bonus: it would be nice to see a preview of the reference, but this is not important for the start) (all of them are in my "own" "_Documents"-folder, so i just need to search there).

 

Can anyone explain/show me how to achieve that? Do I need to supply more information? If yes: which?

 

Thanks in advance,

 Ben

Link to comment

Hi there,

 

i use alfred quite a lot and since i switched from windows half a year ago, but I never managed to get behind workflows. Related to my question in the support forums (http://www.alfredforum.com/topic/2472-is-there-a-way-to-search-inside-files/) I'd like to ask for some assitance in getting a workflow created.

 

What i want to do:

I recently scanned all / most of my documents into PDFs and saved them on my harddisk. Now I need a possibilty to quickly find keywords within that PDFs (bonus: it would be nice to see a preview of the reference, but this is not important for the start) (all of them are in my "own" "_Documents"-folder, so i just need to search there).

 

Can anyone explain/show me how to achieve that? Do I need to supply more information? If yes: which?

 

Thanks in advance,

 Ben

 

Well if these are folders that are in your home folder, then the scope should already be available. Therefore, just using the 'in' keyword in Alfred should allow you to search within your documents for matching text. For example: 'in alfred' would search your documents for files that contain the word 'alfred'. If you want to search only a specific folder, then you could set up a search filter (using a workflow) to search ONLY those documents or ONLY a specific folder. That would allow you to set a keyword to search only that folder instead of all.

 

Which of these methods sounds similar to what you are wanting to achieve?

Link to comment

Well if these are folders that are in your home folder, then the scope should already be available. Therefore, just using the 'in' keyword in Alfred should allow you to search within your documents for matching text. For example: 'in alfred' would search your documents for files that contain the word 'alfred'. If you want to search only a specific folder, then you could set up a search filter (using a workflow) to search ONLY those documents or ONLY a specific folder. That would allow you to set a keyword to search only that folder instead of all.

 

Which of these methods sounds similar to what you are wanting to achieve?

 

Hi David,

 

the last method (search only a specific folder, and it's subfolders) would be the version that i'd love. But tbh i do not know how to achive that. :/

My "_Documents" folder is btw on a USB-Harddrive and not in my user folder.

 

Cheers

Link to comment

Hi there,

 

i use alfred quite a lot and since i switched from windows half a year ago, but I never managed to get behind workflows. Related to my question in the support forums (http://www.alfredforum.com/topic/2472-is-there-a-way-to-search-inside-files/) I'd like to ask for some assitance in getting a workflow created.

 

What i want to do:

I recently scanned all / most of my documents into PDFs and saved them on my harddisk. Now I need a possibilty to quickly find keywords within that PDFs (bonus: it would be nice to see a preview of the reference, but this is not important for the start) (all of them are in my "own" "_Documents"-folder, so i just need to search there).

 

Can anyone explain/show me how to achieve that? Do I need to supply more information? If yes: which?

 

Thanks in advance,

 Ben

 

I haven't tested this, but maybe KMDItemTextContent will search the file's contents. Set up a file filter, hook it up to an 'Open File' action. Use KMDItemTextContent in the filter's settings. See here:

Search%20Content.jpg

 

Don't know how to preview the match, though :(

Link to comment

I haven't tested this, but maybe KMDItemTextContent will search the file's contents. Set up a file filter, hook it up to an 'Open File' action. Use KMDItemTextContent in the filter's settings. See here:

Search%20Content.jpg

 

Don't know how to preview the match, though :(

 

Previewing it wouldn't be possible. Having the folder on an external drive may cause an issue. Does Spotlight index that drive? Can Spotlight search that drive?

Link to comment

ya, spotlight search works fine. I should just use spotlight for this one.

 

The reason I asked was to make sure that that drive was indexed by Spotlight. Alfred uses Spotlight's metadata for searching. By searching with Alfred, you could search ONLY that location to make sure you aren't getting results from other locations mixed in with the items you actually want. You can't preview what text actually matched the search term (you can't do that in Spotlight either) but you can preview the document in Alfred using QuickLook.

Link to comment
  • 11 months later...

Well if these are folders that are in your home folder, then the scope should already be available. Therefore, just using the 'in' keyword in Alfred should allow you to search within your documents for matching text. For example: 'in alfred' would search your documents for files that contain the word 'alfred'. If you want to search only a specific folder, then you could set up a search filter (using a workflow) to search ONLY those documents or ONLY a specific folder. That would allow you to set a keyword to search only that folder instead of all.

 

Which of these methods sounds similar to what you are wanting to achieve?

 

I haven't tested this, but maybe KMDItemTextContent will search the file's contents. Set up a file filter, hook it up to an 'Open File' action. Use KMDItemTextContent in the filter's settings. See here:

Search%20Content.jpg

 

Don't know how to preview the match, though :(

 

 

I'm having difficulty using this technique to search for phrases, rather than words. When I check "split," I get too many results, and when I uncheck it, it doesn't turn up files that I know include the phrase. Any idea what's going on here?

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...