swaxx Posted February 10, 2015 Share Posted February 10, 2015 Hi there i'm currently probing some of Alfreds Actions and Workflows and it seems i'm a bit stuck I'm using a file filter which searches for pdf in a specific folder and opens a pdf with a specific text in it. After that, i have a second action RunNSAppleScript and i want to search for that particular text within the preview app. I'm using "keystroke q" to input the search parameter into the search field but it enters the whole filename there instead of my original search parameter. How do i work that out? Cheers Mike Link to comment
Tyler Eich Posted February 10, 2015 Share Posted February 10, 2015 When you action a file result, Alfred doesn't send your search query as `q`, it sends the path to the file that it found. One solution is to use a script filter, and then set `arg` for each item to your search text. `arg` is passed as `q` when using a script filter Link to comment
swaxx Posted February 10, 2015 Author Share Posted February 10, 2015 Hey, thanks Can you guide me a little bit through that? Do i set up a complete new workflow for that? Or how do i configure the filter so that i can find the pdf or the text in the pdf? Link to comment
Tyler Eich Posted February 11, 2015 Share Posted February 11, 2015 I'm not available to help with this at the moment… I imagine there's a workflow that already implements this mechanism, but I don't know which off the top of my head. Perhaps another forum member can suggest something? Sorry I couldn't be more useful here Link to comment
swaxx Posted February 11, 2015 Author Share Posted February 11, 2015 Hy Tyler, no worries, thanks for your help so far. I need the functionality for my exams where i'm allowed to bring a computer (he has to be offline). So i can search a lot of documents with the help of Alfred, but i really need to expand the search within the document to save valuable time. I hope there's someone who can help me with my dreams Link to comment
swaxx Posted February 16, 2015 Author Share Posted February 16, 2015 Hello Folks, is anyone out there who can help me? Since i'm an absolute beginner in this matter, i'm pretty much stuck here. Cheers, Mike Link to comment
rice.shawn Posted February 16, 2015 Share Posted February 16, 2015 Well, theoretically, you could create a Script Filter with the same keyword as the File Filter. Have the script filter just save the query to some file and output no text. Then, for the AppleScript, read the contents of the file and use that instead of the {query} variable to put into the search. Link to comment
swaxx Posted February 17, 2015 Author Share Posted February 17, 2015 Okay, is there no easier way to achieve that? Unfortunately, i'm not much into scripting and still confused Can anyone of you guide me a bit through this? Link to comment
swaxx Posted February 19, 2015 Author Share Posted February 19, 2015 Ok, i managed it to get the search term saved to a file. But how do i read that as a variable? It seems that it's not picked up by the file reading part of the workflow, the generated file has 2 lines, maybe it takes the second one? Heeeelp 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